<% unless upcoming_events(@item[:academic_year]).empty? %>

Upcoming events

<% upcoming_events(@item[:academic_year]).each_slice(1) do |slice| %>
<% slice.each do |event| %>
<%= render '/partials/_events_tile.*', event: event %>
<% end %>
<% end %> <% end %> <% unless past_events(@item[:academic_year]).empty? %>

Past events

<% past_events(@item[:academic_year]).each_slice(1) do |slice| %>
<% slice.each do |event| %>
<%= render '/partials/_events_tile.*', event: event %>
<% end %>
<% end %> <% end %> <% if past_events(@item[:academic_year]).empty? and upcoming_events(@item[:academic_year]).empty? %>

Sorry.

No events planned yet this year.

Soon TM.

<% end %>