scinote-web/app/views/step_comments/_index.html.erb
2016-11-11 09:09:41 +01:00

29 lines
1.1 KiB
Text

<hr>
<div class="col-xs-12">
<strong><%= t('protocols.steps.comments_tab') %></strong>
</div>
<hr>
<ul class="no-style double-line content-comments">
<% if @comments.length == @per_page %>
<li class="comment-more text-center">
<a class="btn btn-default btn-more-comments" href="<%= more_comments_url %>" data-remote="true">
<%=t "general.more_comments" %>
</a>
</li>
<% end %>
<% 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 %>
</ul>
<% if can_add_step_comment_in_protocol(@protocol) %>
<ul class="no-style double-line">
<li>
<hr>
<%= bootstrap_form_for :comment, url: { format: :json }, html: { class: 'comment-form', id: "step-comment-#{@step.id}" }, method: :post, remote: true do |f| %>
<%= f.text_area :message, class: 'textarea-sm', hide_label: true, placeholder: t("general.comment_placeholder"), append: f.submit("+"), help: '.' %>
<% end %>
</li>
</ul>
<% end %>