2008-06-27 00:13:15 -04:00
<% throw_content :for_sidebar do -%>
2008-06-27 21:28:18 -04:00
<% if allowed_to?(:create_albums) -%><a href="<%= url(:new_album) -%>"><img src="/images/folder-new.png" alt="Create Album" /> Create An Album</a><br /><% end -%>
2008-06-27 00:13:15 -04:00
<% 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 %>
2008-07-04 02:29:10 -04:00
<% unless @album.tags.empty? -%>
<div class="tag_cloud">
<p>Album Tags</p>
<%= @album.tags.collect { |t| "<a href='#{url(:tag, :id => t.name)}' title='#{t.name}'>#{t.name}</a>" }.join(' ') %>
</div>
<% end -%>
<% ptags = @photos.collect { |p| p.photo_tags.collect { |pt| pt.tag.name } }.flatten.uniq -%>
<% unless ptags.empty? -%>
<div class="tag_cloud">
<p>Tags in Photos</p>
<%= ptags.collect { |t| "<a href='#{url(:tag, :id => t)}' title='#{t}'>#{t}</a>" }.join(' ') %>
</div>
<% end -%>
2008-06-27 00:13:15 -04:00
<% end -%>
<% throw_content :for_stylesheet do -%>
2008-06-27 21:54:48 -04:00
.photo_collection_item {
word-wrap: break-word;
2008-06-27 22:03:57 -04:00
max-width: 150px;
2008-06-27 21:54:48 -04:00
max-height: 150px;
margin-top: 15px;
margin-bottom: 15px;
padding: 3px;
border: 1px solid #BBB;
float: left;
position: relative;
}
2008-06-27 22:03:57 -04:00
.col_1, .col_2, .col_0 {
margin-left: 15px;
margin-right: 15px;
2008-06-27 00:13:15 -04:00
}
<% end -%>
<div class="hentry">
<h1><%= @album.name -%></h1>
2008-06-27 22:03:57 -04:00
<% @photos.each_with_index do |photo, idx| -%>
<div class="photo_collection_item col_<%= (idx + 1) % 3 -%>"><a href="<%= url(:photo, photo) -%>" rel="nofollow" onclick="window.open(this.href);return false;"><img src="<%= thumbnail_photo_url(photo) -%>" /></a></div>
<% if (idx + 1) % 3 == 0 or @photos.last == photo -%><br style="clear:both" /><% end -%>
2008-06-27 00:13:15 -04:00
<% end -%>
</div>
2008-06-27 22:03:57 -04:00
<%= partial 'shared/pagination_links' %>