Skip to content

Commit

Permalink
updated event view page to include description and list riders under …
Browse files Browse the repository at this point in the history
…their driver #16
  • Loading branch information
Ruyan Chen committed Feb 16, 2013
1 parent 7bfcc0e commit e6aac1f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ GEM
execjs (1.4.0)
multi_json (~> 1.0)
hike (1.2.1)
hirb (0.7.0)
hirb (0.7.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.7.6)
json (1.7.7)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.5.0)
mime-types (1.21)
multi_json (1.6.1)
pg (0.12.2)
pg (0.12.2-x86-mingw32)
polyglot (0.3.3)
rack (1.4.3)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
Expand All @@ -80,7 +80,7 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rdoc (3.12)
rdoc (3.12.1)
json (~> 1.4)
sass (3.2.5)
sass-rails (3.2.5)
Expand All @@ -94,7 +94,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.5)
sqlite3 (1.3.5-x86-mingw32)
thor (0.16.0)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
polyglot
Expand Down
36 changes: 22 additions & 14 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
<p id="notice"><%= notice %></p>
<% if notice %>
<div id="notice" class="alert alert-success"><%= notice %></div>

This comment has been minimized.

Copy link
@colortheskyjade

colortheskyjade Feb 16, 2013

I'm wondering if there will be any other type of notice but a success one? If so, we need to add the handling for different alert types (alert-warning, etc.) so it's not always green.

<% end %>

<p>
<b>Event Name:</b>
<%= @event.name %>
</p>
<h1 id="eventName"><%= @event.name %></h1>
<dd><em><%= @event.description %></em></dd>
<br/><br/>

<p><u>Drivers </u></p>
<% @drivers.each do |driver| %>
<em><%= driver.name %></em><br/>
<% @riders.each do |rider|
#
# Temporary solution, want to optimize later
#
if rider.driver_id == driver.id %>
<em><%= rider.name %></em><br/>
<% end
end %>
<% end %>
<% if @drivers.empty? %>
<em>Currently no drivers...</em><br/>
<% end %>
<br />
<p><u>Rider </u></p>
<% @riders.each do |rider| %>
<em><%= rider.name %></em><br/>
<% end %>
<% if @riders.empty? %>
<em>Currently no riders...</em><br/>
<% end %>


<br/>
<br />
<%= link_to 'Edit', edit_event_path(@event) %> |
<%= link_to 'Back', events_path %>
<% if notice %>
<script type="text/javascript">
$(document).ready(function () {
$('#notice').delay(2000).fadeOut('slow');
})
</script>
<% end %>

0 comments on commit e6aac1f

Please sign in to comment.