photomix/app/views/albums/show.html.erb
2009-06-12 01:04:57 +02:00

25 lines
865 B
Plaintext

<h2><%= @album.title %></h2>
<div id="multipleimages">
<table>
<% count = 0.0 %>
<% for photo in @album.photos.find(:all, :order => "Id ASC") %>
<% count += 1%>
<% if count == 1 || ( (count-1) / 4.0 == ( (count-1) / 4.0).to_i ) %><tr><% end %>
<td><%= link_to image_tag( photo.path_modified_public("preview") ), [@album.collections.first, @album, photo] %></td>
<% if count / 4.0 == (count / 4.0).to_i %></tr><% end %>
<% end %>
</table>
</div>
<p><%= @album.description %></p>
<% if has_permission?("see_album_note") %>
<p><%= @album.note %></p>
<% end %>
<% if has_role?("admin") %>
<br /><%= link_to "Update album", edit_album_path(@album) %>
<br /><%= link_to "Update photos", edit_multiple_album_photos_path(@album) %>
<br /><%= link_to "Upload photos", upload_album_photos_path(@album) %>
<% end %>
<br /><%= link_to "All albums", albums_path %>