-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
_comments.html.erb
27 lines (21 loc) · 1.03 KB
/
_comments.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<div class="row">
<div id="comments" class="col-lg-10 comments">
<% comments = @node.fetch_comments(current_user) %>
<h3><span id="comment-count"><%= comments.length %></span> <%= t('notes._comments.comments') %></h3>
<div style="margin-bottom: 50px;" id="comments-list">
<% comments.includes(:replied_comments).order('timestamp ASC').each do |comment| %>
<% if comment.cid == @node.comments&.first&.cid %><a id="last" name="last"></a><% end %>
<% if comment.reply_to.nil? %>
<%= render :partial => "notes/comment", :locals => {:comment => comment} %>
<% end %>
<% end %>
</div>
<% if current_user %>
<%= render :partial => "comments/form", :locals => { title: I18n.t('notes._comments.post_comment'), comment: false, placeholder: I18n.t('notes._comments.post_placeholder') } %>
<% else %>
<p><a data-toggle="modal" data-target="#loginModal">
<%= t('layout._header.login.login_title') %> </a> to comment.
</p>
<% end %>
</div>
</div>