scinote-web/app/views/project_comments/_list.html.erb
2016-02-12 16:52:43 +01:00

16 lines
478 B
Text

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