2018-01-16 21:03:22 +08:00
|
|
|
<% if activities.first_page? %>
|
|
|
|
<% 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>
|
2018-01-16 21:03:22 +08:00
|
|
|
<% else %>
|
|
|
|
<li class="text-center activity-date-item">
|
|
|
|
<span class="label label-primary">
|
2018-01-17 19:01:58 +08:00
|
|
|
<%= activities.first.created_at.strftime('%d.%m.%Y') %>
|
2018-01-16 21:03:22 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2018-01-03 20:48:59 +08:00
|
|
|
<% activities.each_with_index do |activity, index| %>
|
2018-01-06 00:08:00 +08:00
|
|
|
<% prevDate = calculate_previous_date(activities, index, previous_activity_created_at) %>
|
2018-01-03 20:48:59 +08:00
|
|
|
<% 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 %>
|