scinote-web/app/views/reports/elements/_step_comments_element.html.erb

40 lines
1.8 KiB
Text
Raw Normal View History

2016-02-12 23:52:43 +08:00
<% if step.blank? and @step.present? then step = @step end %>
<% if order.blank? and @order.present? then order = @order end %>
<% comments = step.step_comments.order(created_at: order) %>
2016-02-12 23:52:43 +08:00
<% timestamp = Time.current + 1.year %>
<% for_export_all = defined?(export_all) && export_all %>
<div class="report-element report-comments-element report-step-comments-element" data-ts="<%= timestamp.to_i %>" data-order="asc" data-type="step_comments" data-id='{ "step_id": <%= step.id %> }' data-scroll-id="<%= step.id %>" data-name="<%=t "projects.reports.elements.step_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">
<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.step_comments.name", step: step.name %>
</div>
<div class="pull-right controls">
<%= render partial: "reports/elements/element_controls.html.erb", locals: { show_sort: true } %>
2016-02-12 23:52:43 +08:00
</div>
</div>
</div>
<div class="report-element-body">
<div class="row">
<div class="col-xs-12 comments-container simple">
<% if comments.any? %>
<ul class="no-style content-comments">
2016-02-12 23:52:43 +08:00
<% comments.each do |comment| %>
<%= 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>
<% else %>
<em><%=t "projects.reports.elements.step_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>