2017-03-10 23:21:43 +08:00
|
|
|
<%= 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? %>
|
2017-03-13 20:20:49 +08:00
|
|
|
|
2017-03-10 23:21:43 +08:00
|
|
|
<% if wopi_file?(asset) %>
|
2017-03-13 20:20:49 +08:00
|
|
|
<%= wopi_asset_file_name(asset) %>
|
2017-03-10 23:21:43 +08:00
|
|
|
<% else %>
|
2018-02-26 21:23:02 +08:00
|
|
|
<p>
|
|
|
|
<%= file_extension_icon(asset) %>
|
|
|
|
<%= truncate(asset.file_file_name,
|
|
|
|
length: Constants::FILENAME_TRUNCATION_LENGTH) %>
|
|
|
|
</p>
|
2017-03-10 23:21:43 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2017-03-13 20:20:49 +08:00
|
|
|
<%= wopi_asset_view_button(asset) %>
|
2017-04-14 22:05:35 +08:00
|
|
|
<% view_only ||= false %>
|
2017-12-07 00:23:08 +08:00
|
|
|
<% if !view_only %>
|
2018-02-02 01:41:28 +08:00
|
|
|
<% if can_manage_protocol_in_module?(@protocol) ||
|
2018-02-16 01:46:29 +08:00
|
|
|
can_manage_protocol_in_repository?(@protocol) %>
|
2017-12-07 00:23:08 +08:00
|
|
|
<%= wopi_asset_edit_button(asset) %>
|
|
|
|
<% end %>
|
2017-03-10 23:21:43 +08:00
|
|
|
<% end %>
|