scinote-web/app/views/activities/_list.html.erb
2018-01-16 14:03:22 +01:00

26 lines
891 B
Text

<% if activities.first_page? %>
<% if activities.first.created_at.to_date == Date.today %>
<li class="text-center activity-date-item">
<span class="label label-primary">
<%=t "activities.index.today" %>
</span>
</li>
<% else %>
<li class="text-center activity-date-item">
<span class="label label-primary">
<%= activity-first.created_at.strftime('%d.%m.%Y') %>
</span>
</li>
<% end %>
<% end %>
<% activities.each_with_index do |activity, index| %>
<% prevDate = calculate_previous_date(activities, index, previous_activity_created_at) %>
<% if activity.created_at.to_date < prevDate %>
<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 %>