2018-01-03 20:48:59 +08:00
|
|
|
<% if activities.first.created_at.to_date == Date.today %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li class="text-center activity-date-item">
|
|
|
|
<span class="label label-primary">
|
|
|
|
<%=t "activities.index.today" %>
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2018-01-03 20:48:59 +08:00
|
|
|
<% activities.each_with_index do |activity, index| %>
|
|
|
|
<% prevDate = activities[index - 1] ? activities[index - 1].created_at.to_date : Date.new(1901, 1, 1) %>
|
|
|
|
<% if activity.created_at.to_date < prevDate %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li class="text-center activity-date-item">
|
|
|
|
<span class="label label-primary">
|
|
|
|
<%= activity.created_at.strftime('%d.%m.%Y') %>
|
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<%= render 'activities/activity.html.erb', activity: activity %>
|
|
|
|
<% end %>
|