photomix/app/views/collections/index.html.erb

37 lines
1.2 KiB
Plaintext

<div class="row">
<%= render 'shared/home_slider' %>
</div>
<div class="clearfix"></div>
<div class="row">
<div class="span12">
<% @collections.in_groups_of(4).each do |group| %>
<% unless group.empty? %>
<ul class="thumbnails">
<% group.compact.each_with_index do |collection, index| %>
<li class="span3">
<div class="thumbnail">
<%= image_tag collection.albums.first.photos.first.attachment.collection.url %>
<div class="caption">
<h5><%= collection.title %></h5>
<p><%= collection.description %></p>
<p class="view-btn"><%= link_to 'View', (collection_path(collection) unless collection.albums.empty? || collection.albums.first.photos.empty?), {:class => 'btn btn-primary'} %></p>
<%= ratings_for collection %>
</div>
</div>
</li>
<% end %>
</ul>
<% end %>
<% end %>
</div>
</div>
<%= content_for :action_links do %>
<% if current_user and current_user.has_role?("admin") %>
<%= link_to "New collection", new_collection_path %>
<% end %>
<% end %>