2016-02-12 23:52:43 +08:00
|
|
|
<% if result.blank? and @result.present? then result = @result end %>
|
|
|
|
<% if order.blank? and @order.present? then order = @order end %>
|
2017-03-17 23:59:40 +08:00
|
|
|
<% comments = result.result_comments.order(created_at: order) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% timestamp = Time.current + 1.year %>
|
2019-12-05 20:27:17 +08:00
|
|
|
<% for_export_all = defined?(export_all) && export_all %>
|
2018-05-22 22:55:58 +08:00
|
|
|
<div class="report-element report-comments-element report-result-comments-element" data-ts="<%= timestamp.to_i %>" data-order="<%= order == :asc ? "asc" : "desc" %>" data-type="result_comments" data-id='{ "result_id": <%= result.id %> }' data-scroll-id="<%= result.id %>" data-name="<%=t "projects.reports.elements.result_comments.sidebar_name" %>" data-icon-class="fas fa-comment">
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="report-element-header">
|
|
|
|
<div class="row">
|
|
|
|
<div class="pull-left comments-icon">
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-comment"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
<div class="pull-left comments-name">
|
|
|
|
<%=t "projects.reports.elements.result_comments.name", result: result.name %>
|
|
|
|
</div>
|
|
|
|
<div class="pull-right controls">
|
2016-08-01 19:19:19 +08:00
|
|
|
<%= render partial: "reports/elements/element_controls.html.erb", locals: { show_sort: true, show_move_up: false, show_move_down: false } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="report-element-body">
|
|
|
|
<div class="row">
|
2019-06-14 22:20:13 +08:00
|
|
|
<div class="col-xs-12 comments-container simple">
|
2019-10-17 19:30:14 +08:00
|
|
|
<% if comments.any? %>
|
2019-06-14 22:20:13 +08:00
|
|
|
<ul class="no-style content-comments">
|
2016-02-12 23:52:43 +08:00
|
|
|
<% comments.each do |comment| %>
|
2019-12-05 20:27:17 +08:00
|
|
|
<%= render partial: 'shared/comments/item.html.erb',
|
|
|
|
locals: { comment: comment, readonly: true, report: true, export_all: for_export_all } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
</ul>
|
2019-10-17 19:30:14 +08:00
|
|
|
<% else %>
|
|
|
|
<em><%=t "projects.reports.elements.result_comments.no_comments" %></em>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="report-element-children">
|
|
|
|
<%= children if (defined? children and children.present?) %>
|
|
|
|
</div>
|
|
|
|
</div>
|