Merge pull request #2097 from aignatov-bio/ai-sci-3930-fix-preview-for-result

Fix preview for result [SCI-3930]
This commit is contained in:
Miha Mencin 2019-09-27 10:48:59 +02:00 committed by GitHub
commit db36f379bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -160,6 +160,19 @@ class AssetsController < ApplicationController
},
formats: :html
)
elsif @asset.result
render_to_string(
partial: 'steps/attachments/item.html.erb',
locals: {
asset: @asset,
i: 0,
assets_count: 0,
step: nil,
order_atoz: 0,
order_ztoa: 0
},
formats: :html
)
else
render_to_string(
partial: 'shared/asset_link',

View file

@ -3,5 +3,6 @@
<% elsif result.is_table %>
<%= render partial: "results/result_table.html.erb", locals: {result: result} %>
<% elsif result.is_asset %>
<%= render partial: "shared/asset_link", locals: { asset: result.asset, display_image_tag: true }, formats: :html %>
<%= render partial: 'steps/attachments/item.html.erb',
locals: { asset: result.asset, i: 0, assets_count: 0, step: nil, order_atoz: 0, order_ztoa: 0 } %>
<% end %>