mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Fix downloading of BioEddie files in reports [SCI-6037] (#3623)
This commit is contained in:
parent
f1e04cc604
commit
2a6b33deec
3 changed files with 19 additions and 7 deletions
|
@ -25,9 +25,15 @@
|
|||
</a>
|
||||
<% else %>
|
||||
<em>
|
||||
<%= t("projects.reports.elements.result_asset.file_name",
|
||||
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
||||
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
|
||||
<%= t("projects.reports.elements.result_asset.file_name", file: truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<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 %>
|
||||
<%= t("projects.reports.elements.result_asset.file_name", file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
||||
<% end %>
|
||||
</em>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -18,9 +18,15 @@
|
|||
</a>
|
||||
<% else %>
|
||||
<em>
|
||||
<%= t('projects.reports.elements.step_asset.file_name',
|
||||
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
||||
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
|
||||
<%= t('projects.reports.elements.step_asset.file_name', file: truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<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 %>
|
||||
<%= t('projects.reports.elements.step_asset.file_name', file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
||||
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
||||
<% end %>
|
||||
</em>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<% 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">
|
||||
<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 %>
|
||||
|
|
Loading…
Reference in a new issue