<% throw_content :for_sidebar do -%> <% if allowed_to?(:create_albums) -%>Create Album Create An Album
<% end -%> <% if allowed_to?(:edit_album) -%> Edit Album
<% end %> <% if allowed_to?(:delete_albums) -%> Destroy Album
<% end %> <% if allowed_to?(:upload_images) -%> Upload Image
<% end %> <% ptags = @photos.collect { |p| p.photo_tags.collect { |pt| pt.tag.name } }.flatten.uniq -%> <% if !@album.tags.empty? or !ptags.empty? -%>
<% unless @album.tags.empty? -%>

Album Tags

<%= @album.tags.collect { |t| "#{t.name}" }.join(' ') %> <% end -%> <% unless ptags.empty? -%>

Tags in Photos

<%= ptags.collect { |t| "#{t}" }.join(' ') %> <% end -%>
<% end -%> <% end -%>

<%= @album.name -%>

<%= partial 'photos', :photos => @photos %>
<%= partial 'shared/pagination_links' %>