mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-02 09:54:37 +08:00
Merge pull request #448 from okriuchykhin/ok_SCI_945
Fix openning of protocol preview with images [SCI-945]
This commit is contained in:
commit
648d256dff
1 changed files with 16 additions and 5 deletions
|
@ -113,13 +113,24 @@
|
|||
<% assets.each do |asset| %>
|
||||
<li>
|
||||
<% if can_view_or_download_step_assets(@protocol) %>
|
||||
<%= link_to download_asset_path(asset), data: {no_turbolink: true, id: true, status: "asset-present"} do %>
|
||||
<%= image_tag preview_asset_path(asset) if asset.is_image? %>
|
||||
<p><%= truncate(asset.file_file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
||||
<% if asset.is_image? %>
|
||||
<%= link_to download_asset_path(asset),
|
||||
class: 'image-preview-link',
|
||||
id: "modal_link#{asset.id}",
|
||||
data: {no_turbolink: true, id: true, status: "asset-present",
|
||||
description: "#{step.position + 1}. #{truncate(step.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %>
|
||||
<%= image_tag asset.url(:medium), data: {'preview-url': large_image_url_asset_path(asset)} %>
|
||||
<p><%= truncate(asset.file_file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to download_asset_path(asset), data: {no_turbolink: true} do %>
|
||||
<p><%= truncate(asset.file_file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= image_tag preview_asset_path(asset) if asset.is_image? %>
|
||||
<%= image_tag asset.url(:medium) if asset.is_image? %>
|
||||
<p><%= truncate(asset.file_file_name,
|
||||
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Reference in a new issue