scinote-web/app/views/activities/_list.html.erb
2017-01-14 10:00:52 +01:00

23 lines
784 B
Text

<%
current_day = days_since_1970(DateTime.current)
%>
<% if !hide_today && activities.count > 0 && days_since_1970(activities[0].created_at) == current_day %>
<li class="text-center activity-date-item">
<span class="label label-primary">
<%=t "activities.index.today" %>
</span>
</li>
<% end %>
<% activities.each do |activity| %>
<% activity_day = days_since_1970(activity.created_at) %>
<% if activity_day < current_day and activity_day < day %>
<% day = days_since_1970(activity.created_at) %>
<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 %>