2016-02-12 23:52:43 +08:00
|
|
|
<div class="panel panel-default panel-archive">
|
|
|
|
|
|
|
|
<div class="dropdown pull-right">
|
2023-06-26 16:29:56 +08:00
|
|
|
<button class="btn dropdown-toggle mt-1 bg-transparent" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
|
|
<span class="sn-icon sn-icon-down"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu1">
|
|
|
|
<li>
|
|
|
|
<% option_text = t("my_modules.module_archive.option_download") %>
|
|
|
|
<% if result.is_asset %>
|
2023-04-24 22:42:49 +08:00
|
|
|
<%= link_to t('my_modules.archive_results.preview'), rails_blob_path(result.asset.file, disposition: 'attachment'),
|
2018-04-13 15:43:14 +08:00
|
|
|
class: 'file-preview-link',
|
|
|
|
id: "modal_link#{result.asset.id}",
|
2018-08-02 17:25:14 +08:00
|
|
|
data: { turbolinks: false, id: true, status: 'asset-present', 'preview-url': asset_file_preview_path(result.asset) } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% elsif result.is_text %>
|
2018-08-02 17:25:14 +08:00
|
|
|
<%= link_to option_text, result_text_download_path(result.result_text_id), data: { turbolinks: false } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% elsif result.is_table %>
|
2018-08-02 17:25:14 +08:00
|
|
|
<%= link_to option_text, result_table_download_path(result.result_table_id), data: { turbolinks: false } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
2022-09-23 18:42:17 +08:00
|
|
|
<% if can_delete_result?(result) && can_manage_my_module?(@my_module) %>
|
2016-09-06 22:16:39 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to t('my_modules.module_archive.option_delete'),
|
|
|
|
result_path(action: :delete, id: result.id),
|
|
|
|
data: {
|
|
|
|
no_turbolink: true ,
|
|
|
|
confirm: t('my_modules.module_archive.confirm_delete')
|
|
|
|
},
|
|
|
|
method: :delete %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">
|
|
|
|
<% if result.is_asset %>
|
2019-06-28 14:17:09 +08:00
|
|
|
<% if result.asset.image? %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<span class="sn-icon sn-icon-files"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<span class="sn-icon sn-icon-files"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
<% elsif result.is_text %>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="fas fa-asterisk"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% elsif result.is_table %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<span class="sn-icon sn-icon-tables"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
<%= result.name %>
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-6">
|
|
|
|
<%=t "my_modules.module_archive.archived_on" %>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-6">
|
|
|
|
<span title="<%=t "my_modules.module_archive.archived_on_title", date: l(result.archived_on, format: :full_date), time: l(result.archived_on, format: :time) %>">
|
|
|
|
<%=l result.archived_on, format: :full_date %>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|