Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (40 sloc) 1.44 KB
<h1 class="trip_index_header" id="headline">Choose Your Time Adventure!</h1>
<div class="trips_container">
<% @trips.each_with_index do |each, index| %>
<% last = (index + 1) % 3 == 0 %>
<div class="span-6 <%= last ? "last" : "" %> trip_entry">
<div class="trip_header"><%= link_to each.name, each %></div>
<div class="trip_tag"><%= h each.tag_line %></div>
<div class="trip_dates">
<%= each.start_date.to_s(:long) %> - <%= each.end_date.to_s(:long) %>
</div>
<div style="text-align: center">
<img src="assets/<%= h each.image_name %>" height="150" width="150">
</div>
<div class="trip_price"><%= number_to_currency each.price%></div>
<div class="trip_links">
<%= link_to "Show Details", each, :class => 'detail_toggle' %>
<div class="detail hidden">
<div>
<%= each.description %>
</div>
</div>
<br />
<% if current_user %>
<% purchased = false %>
<% current_user.purchases.each do |purchase| %>
<% if purchase.trip == each %>
<% purchased = true %>
<% end %>
<% end %>
<% if purchased %>
Bought!
<% else %>
<%= link_to "Go on #{each.name}", purchases_path(:id => each.id),
:method => :post, :class => "purchase_link" %>
<% end %>
<% end %>
</div>
</div>
<% end %>
</div>
Jump to Line
Something went wrong with that request. Please try again.