2016-07-21 19:11:15 +08:00
|
|
|
<% if can_view_or_download_result_assets(result.my_module) %>
|
2016-08-17 21:51:04 +08:00
|
|
|
<%= link_to download_asset_path(result.asset), data: {no_turbolink: true} do %>
|
|
|
|
<%= image_tag(preview_asset_path result.asset) if result.asset.is_image? %>
|
2016-10-04 18:34:43 +08:00
|
|
|
<% if wopi_file?(result.asset) %>
|
|
|
|
<p style='display: inline-block'>
|
|
|
|
<%= file_extension_icon(result.asset) %>
|
|
|
|
<%= truncate(result.asset.file_file_name, length: 50) %>
|
|
|
|
</p>
|
|
|
|
<% else %>
|
|
|
|
<p><%= truncate(result.asset.file_file_name, length: 50) %></p>
|
|
|
|
<% end %>
|
2016-08-17 21:51:04 +08:00
|
|
|
<% end %>
|
2016-10-03 22:49:41 +08:00
|
|
|
<% if result.asset.can_perform_action("view") %>
|
2016-10-04 18:34:43 +08:00
|
|
|
<%= link_to view_asset_url(id: result.asset),
|
|
|
|
class: 'btn btn-default btn-sm',
|
|
|
|
style: 'display: inline-block' do %>
|
|
|
|
<%= file_application_icon(result.asset) %>
|
|
|
|
<%= wopi_button_text(result.asset, 'view') %>
|
|
|
|
<% end %>
|
2016-10-03 22:49:41 +08:00
|
|
|
<% end %>
|
|
|
|
<% if can_edit_result_asset_in_module(result.my_module) &&
|
|
|
|
result.asset.can_perform_action("edit") %>
|
2016-10-04 18:34:43 +08:00
|
|
|
<%= link_to edit_asset_url(id: result.asset),
|
|
|
|
class: 'btn btn-default btn-sm',
|
|
|
|
style: 'display: inline-block' do %>
|
|
|
|
<%= file_application_icon(result.asset) %>
|
|
|
|
<%= wopi_button_text(result.asset, 'edit') %>
|
|
|
|
<% end %>
|
2016-10-03 22:49:41 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
|
|
|
<%= image_tag(preview_asset_path result.asset) if result.asset.is_image? %>
|
2016-10-04 18:34:43 +08:00
|
|
|
<p>
|
|
|
|
<%= file_extension_icon(result.asset) %>
|
|
|
|
<%= truncate(result.asset.file_file_name, length: 50) %>
|
|
|
|
</p>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|