From 5d659a1aa986d8396806b9622126fb757d5d3d3c Mon Sep 17 00:00:00 2001 From: Ben Morimoto Date: Wed, 24 Jun 2015 13:52:52 -0400 Subject: [PATCH] added conditionals to display upcoming and past events properly --- app/views/events/index.html.erb | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 682611fc..fcca8a2c 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -1,25 +1,32 @@
-
+

Events

- <% if @upcoming_events.present? %> -

Join us online or in-person at these upcoming events to build open source and change the world:

+ <% if @public_events.present? %> + +
+ <% if @upcoming_events.present? %> +

Join us online or in-person at these upcoming events to build open source and change the world:

-
- <% @upcoming_events.each do |event| %> -
-
<%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %>
-
+ <% @upcoming_events.each do |event| %> +
+
<%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %>
+
+ <% end %> + <% else %> +

There are no upcoming events.

<% end %> - +
+ +
<% if @past_events.present? %>

Past Events

<% @past_events.each do |event| %> -
-
<%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %>
-
+
+
<%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %>
+
<% end %> <% end %>