Skip to content

Commit

Permalink
Adds direct download link to bottom of stream download form.
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanzus committed Mar 6, 2015
1 parent 2f41005 commit 7b3939c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
43 changes: 34 additions & 9 deletions ooiui/static/css/common/streams.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
div.banner-image {
content: url(/img/OOI_BannerNew_01.png);
max-width: 100%;
max-height: 100%;
content: url(/img/OOI_BannerNew_01.png);
max-width: 100%;
max-height: 100%;
}

.message {
padding-right: 10px;
line-height: 0.2;
padding-right: 10px;
line-height: 0.2;
}


.message h1 {
margin-top: 0px;
margin-bottom: 0px;
font-size: 14px;
margin-top: 0px;
margin-bottom: 0px;
}

.message h3 {
margin-top: 5px;
font-size: 16px;
margin-top: 5px;
font-size: 12px;
}

.message h4 {
margin-top: 5px;
font-size: 6px;
text-align: center;
font-weight: bold;
}

.download-link {
margin-top: 5px;
font-size: 12px;
font-weight: bold;
text-align: center;
}

.download-link a {
color: #8eadd2;
font-size: 12px;
font-weight: bold;
}

.download-link a:hover {
color: #6e91b9;
}
5 changes: 5 additions & 0 deletions ooiui/static/js/partials/StreamDownloadForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ <h3>Ref Def</h3>
</div> <!-- .row -->
<div class="lgn-center">
<button class="btn btn-default" type="button" id="download-btn">Download</button>
<div class="download-link">
<h4>
DownloadLink
</h4>
</div>
</div>
</form>
</div> <!-- lgn-body -->
Expand Down
7 changes: 7 additions & 0 deletions ooiui/static/js/views/science/StreamDownloadFormView.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ var StreamDownloadFormView = Backbone.View.extend({
this.$end_date_picker.setDate(endDate);

this.$el.find('.message h3').text(model.get('display_name'));

// Download Link
var base_url = window.location.origin;
var raw_dl_url = base_url + this.model.getURL(selection);
var dl_url = '<a href=\"' + raw_dl_url + '\">Download Link\</a>';
this.$el.find('.download-link h4').html(dl_url);

this.$el.find('#type-select').val(selection);

this.$el.find('.stream-name').text(model.get('stream_name'));
Expand Down

0 comments on commit 7b3939c

Please sign in to comment.