2016-07-21 19:11:15 +08:00
|
|
|
<div class="result">
|
2020-11-25 23:25:17 +08:00
|
|
|
<div class="result-icon">
|
2016-02-12 23:52:43 +08:00
|
|
|
<% if result.is_text %>
|
2023-06-19 21:45:22 +08:00
|
|
|
<span class="sn-icon sn-icon-result-text"></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
|
|
|
<% elsif result.is_asset %>
|
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 %>
|
|
|
|
</div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<div class="panel-options pull-right">
|
2021-09-14 17:08:35 +08:00
|
|
|
<% if result.editable? && can_manage_my_module?(result.my_module) %>
|
2020-05-03 04:34:11 +08:00
|
|
|
<a class="btn btn-light icon-btn edit-result-button <%= edit_result_button_class(result) %>" id="<%= result.id %>_edit" href="<%= edit_result_link(result) %>" data-remote="true" title="<%= t'my_modules.results.options.edit_title' %>">
|
2023-06-08 14:33:37 +08:00
|
|
|
<span class="sn-icon sn-icon-edit"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
<% end %>
|
2018-02-19 21:47:36 +08:00
|
|
|
<% if can_manage_result?(result) %>
|
2017-05-12 21:59:58 +08:00
|
|
|
<a href="#"
|
2020-05-03 04:34:11 +08:00
|
|
|
class="btn btn-light icon-btn form-submit-link"
|
2017-05-12 21:59:58 +08:00
|
|
|
data-form-id="result-archive-form-<%= result.id %>"
|
|
|
|
data-confirm-text="<%= t('my_modules.results.archive_confirm') %>"
|
2023-05-16 15:34:36 +08:00
|
|
|
title="<%= t'my_modules.results.options.archive_title' %>">
|
2023-06-19 21:45:22 +08:00
|
|
|
<span class="sn-icon sn-icon-archive"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
<%= form_for :result, url: result_path_of_type(result), method: :patch, html: {id: 'result-archive-form-' + result.id.to_s } do |f| %>
|
|
|
|
<%= f.hidden_field :archived, value: true %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2020-07-28 21:39:29 +08:00
|
|
|
<a class="result-panel-collapse-link" href="#result-panel-<%= result.id %>" data-toggle="collapse">
|
2023-06-15 21:12:51 +08:00
|
|
|
<span class="sn-icon sn-icon-right"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<strong><%= result.name %></strong> |
|
2022-12-02 00:13:26 +08:00
|
|
|
<span><%= t('my_modules.results.published_on_html', timestamp: l(result.created_at, format: :full), user: h(result.user.full_name)) %></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="panel-collapse collapse" id="result-panel-<%= result.id %>" role="tabpanel">
|
|
|
|
<div class="panel-body">
|
2016-09-29 22:43:19 +08:00
|
|
|
<div class="row">
|
2018-06-08 20:22:03 +08:00
|
|
|
<div class="col-xs-12" data-hook="result-content">
|
2016-09-29 22:43:19 +08:00
|
|
|
<%= render partial: 'my_modules/result_user_generated.html.erb',
|
2016-11-10 21:11:32 +08:00
|
|
|
locals: { result: result } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_read_experiment?(@my_module.experiment) %>
|
2016-09-29 22:43:19 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="result-comment"
|
|
|
|
id="result-comments-<%= result.id %>"
|
|
|
|
data-href="<%= result_result_comments_url(result) %>">
|
2018-11-13 23:57:42 +08:00
|
|
|
<%= render partial: "result_comments/index.html.erb",
|
|
|
|
locals: { result: result, comments: result.last_comments, per_page: Constants::COMMENTS_SEARCH_LIMIT } %>
|
2016-09-29 22:43:19 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|