scinote-web/app/views/step_comments/_index.html.erb
Luka Murn bac0455435 Add edit&delete functionality to step comments
This commit also:
* fixes a bug in permission_helper.rb,
* fixes comments.js a bit,
* adds 2 more re-renders of dropdown position calculations to canvas.js and projects/index.js.
2016-08-25 13:51:31 +02:00

27 lines
974 B
Plaintext

<h5 class="text-center"><%= t('protocols.steps.comments_tab') %></h5>
<hr>
<ul class="no-style double-line content-comments">
<% 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 %>
<% 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 %>
</ul>
<% if can_add_step_comment_in_protocol(@protocol) %>
<ul class="no-style double-line">
<li>
<hr>
<%= bootstrap_form_for :comment, url: { format: :json }, method: :post, remote: true do |f| %>
<%= f.text_field :message, hide_label: true, placeholder: t("general.comment_placeholder"), append: f.submit("+"), help: '.' %>
<% end %>
</li>
</ul>
<% end %>