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:
aignatov-bio 2021-07-20 13:22:42 +02:00 committed by GitHub
parent 4de35c983a
commit 067758808e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 %>