diff --git a/content/events.erb b/content/events.erb index ce70c98..7dd7cda 100644 --- a/content/events.erb +++ b/content/events.erb @@ -3,59 +3,32 @@ navigable: true title: Events order: 20 --- - -
+

Upcoming events

-
<% upcoming_events.each_slice(2) do |slice| %> - -
- <% slice.each do |event| %> - <% if (sub_events(event)).empty? %> -
- <%= render '/partials/_events_tile.*', - article: event, - small_text: event[:time].strftime('%A %d %B %Y %H:%M'), - location: event[:location], - color: event[:color] %> -
- - <% end %> +
+ <% slice.each do |event| %> +
+ <%= render '/partials/_events_tile.*', event: event %>
+ <% end %> +
<% end %>
-
+ +
+

Past events

<% past_events.each_slice(2) do |slice| %> - -
- <% slice.each do |event| %> - <% if (sub_events(event)).empty? %> -
- <%= render '/partials/_events_tile.*', - article: event, - small_text: event[:time].strftime('%A %d %B %Y %H:%M'), - location: event[:location], - color: event[:color] %> -
- - <% end %> +
+ <% slice.each do |event| %> +
+ <%= render '/partials/_events_tile.*', event: event %>
- <%end%> - + <% end %> +
+ <% end %>
diff --git a/content/index.erb b/content/index.erb index 53b5593..a50da53 100644 --- a/content/index.erb +++ b/content/index.erb @@ -24,10 +24,8 @@
-
- <%= render '/partials/_tile.*', - article: upcoming_events[0] || all_events[-1], - small_text: if upcoming_events[0] then "Upcoming event" else "Past event" end%> +
+ <%= render '/partials/_events_tile.*', event: upcoming_events[0] || all_events[-1] %>
@@ -41,13 +39,10 @@
<% all_events.reject { |x| x == upcoming_events[0] }.reverse[0..2].each do |event| %> -
- <%= render '/partials/_tile.*', - article: event, - small_text: upcoming_events.include?(event) ? "Upcoming event" : "Past event", - htmlclass:"highlighted" %> +
+ <%= render '/partials/_events_tile.*', event: event %>
- <%end%> + <%end%>