scinote-web/app/views/step_comments/_index.html.erb

27 lines
1 KiB
Plaintext
Raw Normal View History

2016-09-16 15:04:21 +08:00
<h5 class="text-center"><%= t('protocols.steps.comments_tab') %></h5>
2016-02-12 23:52:43 +08:00
<hr>
<ul class="no-style double-line content-comments">
<% if @comments.length == @per_page %>
<li class="comment-more text-center">
2016-02-12 23:52:43 +08:00
<a class="btn btn-default btn-more-comments" href="<%= more_comments_url %>" data-remote="true">
<%=t "general.more_comments" %>
</a>
</li>
<% end %>
2016-09-16 21:22:24 +08:00
<% if @comments.size == 0 then %>
<li class="no-comments"><em><%= t 'general.no_comments' %></em></li>
<% else %>
<%= render 'step_comments/list.html.erb', comments: @comments %>
<% end %>
2016-02-12 23:52:43 +08:00
</ul>
2016-07-21 19:11:15 +08:00
<% if can_add_step_comment_in_protocol(@protocol) %>
2016-02-12 23:52:43 +08:00
<ul class="no-style double-line">
<li>
<hr>
2016-09-16 15:04:21 +08:00
<%= bootstrap_form_for :comment, url: { format: :json }, html: { class: 'comment-form', id: "step-comment-#{@step.id}" }, method: :post, remote: true do |f| %>
2016-02-12 23:52:43 +08:00
<%= f.text_field :message, hide_label: true, placeholder: t("general.comment_placeholder"), append: f.submit("+"), help: '.' %>
<% end %>
</li>
</ul>
<% end %>