scinote-web/app/views/project_comments/_list.html.erb
Luka Murn 15c0baeee8 Add delete project comment functionality
This commit also removes the old code from @bberic.
2016-08-25 13:51:30 +02:00

19 lines
530 B
Text

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