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

31 lines
1.2 KiB
Plaintext
Raw Normal View History

2012-07-24 23:26:16 +02:00
<% @collections.in_groups_of(4).compact.each do |group| %>
<% unless group.compact.empty? %>
<ul class="thumbnails">
<% group.compact.each do |collection| %>
<% unless collection.albums.empty? %>
<% unless collection.albums.first.photos.empty? %>
<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><%= link_to 'View', (collection_path(collection) unless collection.albums.empty? || collection.albums.first.photos.empty?), {:class => 'btn btn-primary'} %></p>
</div>
</div>
</li>
<% end %>
<% end %>
<% end %>
</ul>
<% end %>
2009-06-11 13:05:09 +02:00
<% end %>
2012-07-24 23:26:16 +02:00
2011-04-25 07:54:40 +02:00
<%= content_for :action_links do %>
2012-07-24 23:26:16 +02:00
<% if current_user and current_user.has_role?("admin") %>
<%= link_to "New collection", new_collection_path %>
<% end %>
2009-06-16 21:43:03 +02:00
<% end %>
2012-07-24 23:26:16 +02:00