This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/app/views/albums/show.html.erb

31 lines
1.4 KiB
Plaintext

<% throw_content :for_sidebar do -%>
<% if allowed_to?(:edit_album) -%><a href="<%= url(:edit_album, :id => @album.name.gsub(/ /, '_')) -%>" rel="nofollow"><img src="/images/document-save.png" /> Edit Album</a><br /><% end %>
<% if allowed_to?(:delete_albums) -%><a href="<%= url(:delete_album, :id => @album.name.gsub(/ /, '_')) -%>" onclick="if(!confirm('Are you sure you want to delete this album?')){return false;}"><img src="/images/edit-delete.png" /> Destroy Album</a><br /><% end %>
<% if allowed_to?(:upload_images) -%><a href="<%= url(:new_photo, :photo => { :album_id => @album.id }) -%>"><img src="/images/emblem-photos.png" /> Upload Image</a><br /><% end %>
<% end -%>
<% throw_content :for_stylesheet do -%>
.photo {
margin: 10px;
}
<% end -%>
<div class="hentry">
<h1><%= @album.name -%></h1>
<% @album.photos.each_with_index do |photo, idx| -%>
<% if (idx + 1) % 3 == 1 -%><p><% end -%>
<span class="photo"><a href="<%= url(:photo, photo) -%>" rel="nofollow" onclick="window.open(this.href);return false;"><img src="<%= thumbnail_photo_url(photo) -%>" /></a></span>
<% if (idx + 1) % 3 == 0 or @album.photos.size == (idx + 1) -%></p><% end -%>
<% end -%>
<% unless @album.tags.empty? -%>
<br style="clear: both;" />
<ul class="meta">
<li>Tags: <%= @album.tags.collect { |t| "<a href='#{url(:tag, :id => t.name)}' title='#{t.name}'>#{t.name}</a>" }.join(' ') -%></li>
</ul>
<% end -%>
</div>