Permalink
Browse files

Merge remote-tracking branch 'alexshook/update_language_for_past_even…

…ts' into update_language_for_past_events
  • Loading branch information...
courte committed Feb 26, 2015
2 parents d94b5a3 + 04bd359 commit f3bd04c6db82cb297320ba44fab703e375b9d1e4
@@ -7,3 +7,7 @@
.check-in {
margin-top:25px;
}
.top-25 {
padding-top: 25px;
}
@@ -12,7 +12,8 @@ def create
end
def index
@events = Event.public_events.order("start_date desc")
@upcoming_events = Event.upcoming_events.public_events.order("start_date desc")
@past_events = Event.past_events.public_events.order("start_date desc")
end
def show
View
@@ -27,6 +27,7 @@ class Event < ActiveRecord::Base
friendly_id :name, use: :slugged
scope :upcoming_events, -> { where("end_date >= ?", Time.now) }
scope :past_events, -> { where("end_date < ?", Time.now) }
scope :public_events, -> { where(is_public: true) }
def self.featured
@@ -114,6 +115,14 @@ def fetch_engagement_stats
stats
end
def upcoming?
true if end_date >= Time.now
end
def past?
true if end_date < Time.now
end
private
def delete_logo
@@ -2,16 +2,27 @@
<div>
<h4>Events</h4>
<% if @events.present? %>
<% 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">
<% @events.each do |event| %>
<% @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 %>
<% 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>
<% end %>
<% end %>
</div>
<% else %>
<p>Oops! We can't seem to find any events. <%= link_to "Jump into a project", projects_path %>, or <%= link_to "reach out to an organization", organizations_path %> directly.</p>
@@ -23,3 +34,4 @@
<%= render "check_in_prompt" %>
<% end %>
</div>
@@ -9,18 +9,26 @@
<div id="event_rsvp_top" class="row">
<div class="large-10 columns large-centered text-center">
<%= %>
<% if @event.eventbrite_url.present? %>
<%= link_to "RSVP for the " + @event.name, @event.eventbrite_url, :class => "large index radius button" %>
<%= %>
<% if @event.upcoming? %>
<% if @event.eventbrite_url.present? %>
<%= link_to "RSVP for the " + @event.name, @event.eventbrite_url, :class => "large index radius button" %>
<% else %>
<%= link_to "Join the " + @event.name, dashboard_path, :class => "large index radius button" %>
<% end %>
<% else %>
<%= link_to "Join the " + @event.name, dashboard_path, :class => "large index radius button" %>
<%= link_to "Too late! View More Events", events_path, :class => "large index radius button" %>
<% end %>
</div>
</div>
<div>
<p class="text-center"><strong>Join us <%= @event.start_date.strftime("%B %d, %Y") %> for the </strong></p>
</div>
<% if @event.upcoming? %>
<div>
<p class="text-center"><strong>Join us <%= @event.start_date.strftime("%B %d, %Y") %> for the </strong></p>
</div>
<% else %>
<p class="text-center"><strong><%= @event.start_date.strftime("%B %d, %Y") %></strong></p>
<% end %>
<div class="large-10 columns large-centered text-center">
<h1><%= @event.name %></h1>
@@ -66,11 +74,15 @@
<div id="event_rsvp_bottom" class="row">
<div class="large-6 columns large-centered text-center">
<%= %>
<% if @event.eventbrite_url.present? %>
<%= link_to "RSVP for the " + @event.name, @event.eventbrite_url, :class => "large index radius button" %>
<% else %>
<%= link_to "Join the " + @event.name, dashboard_path, :class => "large index radius button" %>
<% end %>
<% if @event.upcoming? %>
<% if @event.eventbrite_url.present? %>
<%= link_to "RSVP for the " + @event.name, @event.eventbrite_url, :class => "large index radius button" %>
<% else %>
<%= link_to "Join the " + @event.name, dashboard_path, :class => "large index radius button" %>
<% end %>
<% else %>
<%= link_to "Too late! View More Events", events_path, :class => "large index radius button" %>
<% end %>
</div>
</div>

0 comments on commit f3bd04c

Please sign in to comment.