Merge pull request #5125 from dannon/download_fixes

Download fixes
This commit is contained in:
Björn Grüning
2017-12-19 20:07:35 +01:00
committed by GitHub
3 changed files with 31 additions and 39 deletions
+29 -37
View File
@@ -286,47 +286,39 @@ var DatasetListItemView = _super.extend(
return this._renderMetaFileDownloadButton();
}
return $(
[
'<a class="download-btn icon-btn" ',
'href="',
this.model.urls.download,
`" title="${_l("Download")}" download>`,
'<span class="fa fa-floppy-o"></span>',
"</a>"
].join("")
);
return $(`
<a class="download-btn icon-btn" href="${this.model.urls.download}" title="${_l("Download")}">
<span class="fa fa-floppy-o"></span>
</a>`);
},
/** Render the download button which opens a dropdown with links to download assoc. meta files (indeces, etc.) */
/** Render the download button which opens a dropdown with links to download assoc. meta files (indices, etc.) */
_renderMetaFileDownloadButton: function() {
var urls = this.model.urls;
return $(
[
'<div class="metafile-dropdown dropdown">',
'<a class="download-btn icon-btn" href="javascript:void(0)" data-toggle="dropdown"',
` title="${_l("Download")}">`,
'<span class="fa fa-floppy-o"></span>',
"</a>",
'<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">',
`<li><a href="${urls.download}" download>`,
_l("Download dataset"),
"</a></li>",
_.map(this.model.get("meta_files"), meta_file =>
[
'<li><a href="',
urls.meta_download + meta_file.file_type,
'">',
_l("Download"),
" ",
meta_file.file_type,
"</a></li>"
].join("")
).join("\n"),
"</ul>",
"</div>"
].join("\n")
);
return $(`
<div class="metafile-dropdown dropdown">
<a class="download-btn icon-btn" href="${urls.download}" data-toggle="dropdown" title="${_l(
"Download"
)}">
<span class="fa fa-floppy-o"></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li>
<a href="${urls.download}">
${_l("Download dataset")}
</a>
</li>
${_.map(
this.model.get("meta_files"),
meta_file =>
`<li>
<a href="${urls.meta_download + meta_file.file_type}">
${_l("Download")} ${meta_file.file_type}
</a>
</li>`
)}
</ul>
</div>`);
},
_renderNametags: function() {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long