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 %>
|
2017-03-17 23:59:40 +08:00
|
|
|
<% comments = step.step_comments.order(created_at: order) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% timestamp = Time.current + 1.year %>
|
2017-06-20 22:07:34 +08:00
|
|
|
<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="glyphicon glyphicon-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="glyphicon glyphicon-comment"></span>
|
|
|
|
</div>
|
|
|
|
<div class="pull-left comments-name">
|
|
|
|
<%=t "projects.reports.elements.step_comments.name", step: step.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 } %>
|
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">
|
|
|
|
<% if comments.count == 0 %>
|
|
|
|
<em><%=t "projects.reports.elements.step_comments.no_comments" %></em>
|
|
|
|
<% else %>
|
|
|
|
<ul class="no-style comments-list">
|
|
|
|
<% comments.each do |comment| %>
|
|
|
|
<% comment_ts = comment.created_at %>
|
|
|
|
<li class="comment" data-ts="<%= comment_ts.to_i %>">
|
|
|
|
<span class="comment-prefix">
|
|
|
|
<em><%=t "projects.reports.elements.step_comments.comment_prefix", user: comment.user.full_name, date: l(comment_ts, format: :full_date), time: l(comment_ts, format: :time) %></em>
|
|
|
|
</span>
|
|
|
|
<span class="comment-message">
|
|
|
|
|
2017-01-24 23:44:56 +08:00
|
|
|
<%= custom_auto_link(comment.message) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="report-element-children">
|
|
|
|
<%= children if (defined? children and children.present?) %>
|
|
|
|
</div>
|
|
|
|
</div>
|