% throw_content :for_sidebar do -%>
<% if allowed_to?(:create_albums) -%> 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? and !ptags.empty? -%>
Album Tags
<%= @album.tags.collect { |t| "#{t.name}" }.join(' ') %> <% end -%> <% unless ptags.empty? -%>Tags in Photos
<%= ptags.collect { |t| "#{t}" }.join(' ') %> <% end -%>