Skip to content

Commit

Permalink
added conditionals to display upcoming and past events properly
Browse files Browse the repository at this point in the history
  • Loading branch information
bkmorimoto committed Jun 24, 2015
1 parent 5e3ace4 commit 5d659a1
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions app/views/events/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
<div class="row">
<div>
<div class="events">
<h4>Events</h4>

<% if @upcoming_events.present? %>
<p>Join us online or in-person at these upcoming events to build open source and change the world:</p>
<% if @public_events.present? %>

<div class="upcoming-events">
<% if @upcoming_events.present? %>
<p>Join us online or in-person at these upcoming events to build open source and change the world:</p>

<div class="events">
<% @upcoming_events.each do |event| %>
<div class="large-10 centered">
<h5><%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %></h5>
</div>
<% @upcoming_events.each do |event| %>
<div class="large-10 centered">
<h5><%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %></h5>
</div>

<% end %>
<% else %>
<p>There are no upcoming events.</p>
<% end %>
</div>

<div class="past-events">
<% if @past_events.present? %>
<h4 class="top-25">Past Events</h4>

<% @past_events.each do |event| %>
<div class="large-10 centered">
<h5><%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %></h5>
</div>
<div class="large-10 centered">
<h5><%= link_to event.name + " - " + event.start_date.strftime("%B %d, %Y"), event_path(event) %></h5>
</div>

<% end %>
<% end %>
Expand Down

0 comments on commit 5d659a1

Please sign in to comment.