mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-07 07:26:20 +08:00
21 lines
754 B
Text
21 lines
754 B
Text
<% query ||= nil %>
|
|
<% text = query.present? ? highlight(asset.file_file_name, query.strip.split(/\s+/)) : asset.file_file_name %>
|
|
|
|
<% if asset.step %>
|
|
<% protocol = asset.step.protocol %>
|
|
<% if protocol.in_module? && can_view_or_download_step_assets(protocol) %>
|
|
<a href="<%= download_asset_path asset %>" target="_blank">
|
|
<%= text %>
|
|
</a>
|
|
<% elsif protocol.in_repository? && can_read_protocol_in_repository?(protocol) %>
|
|
<a href="<%= download_asset_path asset %>" target="_blank">
|
|
<%= text %>
|
|
</a>
|
|
<% end %>
|
|
<% elsif asset.result and can_view_or_download_result_assets(asset.result.my_module) %>
|
|
<a href="<%= download_asset_path asset %>" target="_blank">
|
|
<%= text %>
|
|
</a>
|
|
<% else %>
|
|
<%= text %>
|
|
<% end %>
|