scinote-web/app/views/my_module_comments/_list.html.erb

15 lines
528 B
Text

<% day = 0 %>
<% current_day = days_since_1970(DateTime.current) %>
<% comments.each do |comment| %>
<% comment_day = days_since_1970(comment.created_at) %>
<% if comment_day <= current_day && comment_day > day %>
<% day = days_since_1970(comment.created_at) %>
<li class="comment-date-separator">
<p class="text-center"><%= comment.created_at.strftime('%d.%m.%Y') %></p>
</li>
<% end %>
<li class="comment">
<%= render 'my_module_comments/comment.html.erb', comment: comment %>
</li>
<% end %>