set album tags in sidebar, show tags for photos on page, and make tag_cloud a class instead of an css id
parent
c0bea1ce85
commit
b5142c06f1
|
@ -1,7 +1,7 @@
|
|||
<% throw_content :for_sidebar do -%>
|
||||
<% 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 -%>
|
||||
<% if allowed_to?(:upload_images) -%><a href="<%= url(:new_photo) -%>"><img src="/images/emblem-photos.png" /> Upload Image</a><br /><% end %>
|
||||
<div id="tag_cloud">
|
||||
<div class="tag_cloud">
|
||||
<p>Popular Tags</p>
|
||||
<%= tag_cloud @tags %>
|
||||
</div>
|
||||
|
|
|
@ -3,6 +3,21 @@
|
|||
<% 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 %>
|
||||
|
||||
<% 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 -%>
|
||||
<% end -%>
|
||||
|
||||
<% throw_content :for_stylesheet do -%>
|
||||
|
@ -33,13 +48,6 @@
|
|||
<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 -%>
|
||||
<% 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>
|
||||
|
||||
<%= partial 'shared/pagination_links' %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% throw_content :for_sidebar do -%>
|
||||
<div id="tag_cloud">
|
||||
<div class="tag_cloud">
|
||||
<p>Popular Tags</p>
|
||||
<%= tag_cloud @tags %>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% throw_content :for_sidebar do -%>
|
||||
<div id="tag_cloud">
|
||||
<div class="tag_cloud">
|
||||
<p>Popular Tags</p>
|
||||
<%= tag_cloud @tags %>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% if @tags.empty? -%>
|
||||
<p><em><strong>No tags were found!</strong></em></p>
|
||||
<% else -%>
|
||||
<div id="tag_cloud">
|
||||
<div class="tag_cloud">
|
||||
<p>All Tags in TuxBliki</p>
|
||||
<%= tag_cloud @tags -%>
|
||||
</div>
|
||||
|
|
|
@ -302,7 +302,7 @@
|
|||
|
||||
#sidebar em { font-style: normal; }
|
||||
|
||||
#tag_cloud, #things_i_do {
|
||||
.tag_cloud, #things_i_do {
|
||||
padding: 5px 10px 10px 10px;
|
||||
margin-right: 15px;
|
||||
margin-left: auto;
|
||||
|
@ -312,7 +312,7 @@
|
|||
border: 1px solid #BBB;
|
||||
}
|
||||
|
||||
#tag_cloud p, #things_i_do .title {
|
||||
.tag_cloud p, #things_i_do .title {
|
||||
font-size: 1.1em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
|
Reference in New Issue