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

16 lines
527 B
Text
Raw Normal View History

<% day = 0 %>
<% current_day = days_since_1970(DateTime.current) %>
2016-02-12 23:52:43 +08:00
<% comments.each do |comment| %>
<% comment_day = days_since_1970(comment.created_at) %>
2016-10-03 22:10:20 +08:00
<% if comment_day <= current_day && comment_day > day %>
<% day = days_since_1970(comment.created_at) %>
<li class="comment-date-separator">
<p class="text-center"><%= l(comment.created_at, format: :full_date) %></p>
</li>
2016-02-12 23:52:43 +08:00
<% end %>
<li class="comment">
<%= render 'result_comments/comment.html.erb', comment: comment %>
</li>
2016-02-12 23:52:43 +08:00
<% end %>