Merge pull request #1163 from mlorb/ml-sci-2425

Fix bug with protocol preview does not open… [SCI-2425]
This commit is contained in:
mlorb 2018-05-24 13:46:16 +02:00 committed by GitHub
commit f466c4afa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,46 +112,7 @@
<ul>
<% assets.each do |asset| %>
<li>
<% if can_read_protocol_in_repository?(@protocol) %>
<% if asset.file_present %>
<% if asset.file.processing? %>
<span data-status='asset-loading'
data-present-url='<%= file_present_asset_path(asset) %>'>
<%= image_tag 'medium/processing.gif' %>
</span>
<% else %>
<% if asset.is_image? %>
<%= link_to download_asset_path(asset),
class: 'file-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': asset_file_preview_path(asset)} %>
<p><%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
<% end %>
<% else %>
<%= render partial: 'steps/wopi_controlls.html.erb', locals: { asset: asset, view_only: true } %>
<% end %>
<% end %>
<% else %>
<span data-status='asset-loading'
data-present-url='<%= file_present_asset_path(asset) %>'>
<%= image_tag 'medium/processing.gif' %>
</span>
<% end %>
<% else %>
<% if asset.file.processing? %>
<span data-status='asset-loading'
data-present-url='<%= file_present_asset_path(asset) %>'>
<%= image_tag 'medium/processing.gif' %>
</span>
<% else %>
<%= image_tag asset.url(:medium) if asset.is_image? %>
<% end %>
<p><%= truncate(asset.file_file_name,
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
<% end %>
<%= render partial: "shared/asset_link", locals: { asset: asset, display_image_tag: true }, formats: :html %>
</li>
<% end %>
</ul>