2016-09-20 20:13:40 +08:00
|
|
|
<hr>
|
2016-09-29 22:43:19 +08:00
|
|
|
<div class="col-xs-12">
|
2016-09-29 20:37:29 +08:00
|
|
|
<strong><%= t('protocols.steps.comments_tab') %></strong>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
<hr>
|
|
|
|
<ul class="no-style double-line content-comments">
|
2018-11-13 23:57:42 +08:00
|
|
|
<% if comments.size == per_page %>
|
|
|
|
<li class="comment-more text-center">
|
|
|
|
<a class="btn btn-default btn-more-comments"
|
|
|
|
href="<%= url_for(step_step_comments_path(step, format: :json, from: comments.first.id)) %>"
|
|
|
|
data-remote="true">
|
|
|
|
<%=t "general.more_comments" %>
|
|
|
|
</a>
|
|
|
|
</li>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2018-11-13 23:57:42 +08:00
|
|
|
<% if comments.size == 0 %>
|
2016-09-16 21:22:24 +08:00
|
|
|
<li class="no-comments"><em><%= t 'general.no_comments' %></em></li>
|
|
|
|
<% else %>
|
2018-11-13 23:57:42 +08:00
|
|
|
<%= render 'step_comments/list.html.erb', comments: comments %>
|
2016-09-16 21:22:24 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</ul>
|
2018-02-16 01:46:29 +08:00
|
|
|
<% if can_create_comments_in_module?(@protocol.my_module) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<ul class="no-style double-line">
|
|
|
|
<li>
|
|
|
|
<hr>
|
2018-11-13 23:57:42 +08:00
|
|
|
<%= bootstrap_form_for :comment,
|
|
|
|
url: step_step_comments_path(step, format: :json),
|
|
|
|
html: { class: 'comment-form', id: "step-comment-#{step.id}" },
|
|
|
|
method: :post,
|
|
|
|
remote: true do |f| %>
|
2017-01-11 21:56:47 +08:00
|
|
|
<%= f.smart_text_area :message,
|
|
|
|
single_line: true,
|
|
|
|
hide_label: true,
|
|
|
|
placeholder: t("general.comment_placeholder"),
|
|
|
|
append: f.submit("+"),
|
|
|
|
help: '.',
|
|
|
|
data: { 'atwho-edit' => '' } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|