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

24 lines
786 B
Text
Raw Normal View History

2016-02-12 23:52:43 +08:00
<%
current_day = days_since_1970(DateTime.current)
2016-02-12 23:52:43 +08:00
%>
<% if !hide_today and activities.count > 0 and days_since_1970(activities[0].created_at) == current_day %>
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 %>
<% activities.each do |activity| %>
<% activity_day = days_since_1970(activity.created_at) %>
2016-02-12 23:52:43 +08:00
<% if activity_day < current_day and activity_day < day %>
<% day = days_since_1970(activity.created_at) %>
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 %>