mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 12:43:06 +08:00
Add download heml button to file preview [SCI-5876] (#3423)
* Add download heml button to file preview [SCI-5876] * Remove safe navigation
This commit is contained in:
parent
4de35c983a
commit
067758808e
1 changed files with 10 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<div class="modal-header">
|
||||
<span class="file-name"><%= asset.file_name %></span>
|
||||
<span class="file-name"><%= asset.file.metadata[:name] || asset.file_name %></span>
|
||||
<div class="sci-btn-group">
|
||||
<% if can_edit && !preview %>
|
||||
<% if wopi_enabled? && wopi_file?(asset) %>
|
||||
|
@ -47,9 +47,15 @@
|
|||
</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<a class="btn btn-light file-download-link" href="<%= rails_blob_path(asset.file, disposition: 'attachment') %>" data-turbolinks="false">
|
||||
<span class="fas fa-download"></span> <%= t('Download')%>
|
||||
</a>
|
||||
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
|
||||
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
|
||||
<span class="fas fa-download"></span> <%= t('Download')%>
|
||||
</a>
|
||||
<% else %>
|
||||
<a class="btn btn-light file-download-link" href="<%= rails_blob_path(asset.file, disposition: 'attachment') %>" data-turbolinks="false">
|
||||
<span class="fas fa-download"></span> <%= t('Download')%>
|
||||
</a>
|
||||
<% end %>
|
||||
<% if (asset.step || asset.result) && !preview %>
|
||||
<%= render partial: 'assets/asset_context_menu.html.erb', locals: { asset: asset, deletable: false, editable: false } %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue