From b5142c06f19ac88b62820b4b0a1630c33c95f0c6 Mon Sep 17 00:00:00 2001 From: Coleman Date: Fri, 4 Jul 2008 01:29:10 -0500 Subject: [PATCH] set album tags in sidebar, show tags for photos on page, and make tag_cloud a class instead of an css id --- app/views/albums/index.html.erb | 2 +- app/views/albums/show.html.erb | 22 +++++++++++++++------- app/views/news/index.html.erb | 2 +- app/views/pages/index.html.erb | 2 +- app/views/tags/index.html.erb | 2 +- public/stylesheets/content.css | 4 ++-- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/views/albums/index.html.erb b/app/views/albums/index.html.erb index 9598ce3..4f33d08 100644 --- a/app/views/albums/index.html.erb +++ b/app/views/albums/index.html.erb @@ -1,7 +1,7 @@ <% throw_content :for_sidebar do -%> <% if allowed_to?(:create_albums) -%>Create Album Create An Album
<% end -%> <% if allowed_to?(:upload_images) -%> Upload Image
<% end %> -
+

Popular Tags

<%= tag_cloud @tags %>
diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb index 1e779bc..8c09988 100644 --- a/app/views/albums/show.html.erb +++ b/app/views/albums/show.html.erb @@ -3,6 +3,21 @@ <% if allowed_to?(:edit_album) -%> Edit Album
<% end %> <% if allowed_to?(:delete_albums) -%> Destroy Album
<% end %> <% if allowed_to?(:upload_images) -%> Upload Image
<% end %> + + <% unless @album.tags.empty? -%> +
+

Album Tags

+ <%= @album.tags.collect { |t| "#{t.name}" }.join(' ') %> +
+ <% end -%> + + <% ptags = @photos.collect { |p| p.photo_tags.collect { |pt| pt.tag.name } }.flatten.uniq -%> + <% unless ptags.empty? -%> +
+

Tags in Photos

+ <%= ptags.collect { |t| "#{t}" }.join(' ') %> +
+ <% end -%> <% end -%> <% throw_content :for_stylesheet do -%> @@ -33,13 +48,6 @@
<% if (idx + 1) % 3 == 0 or @photos.last == photo -%>
<% end -%> <% end -%> - -<% unless @album.tags.empty? -%> -
- -<% end -%>
<%= partial 'shared/pagination_links' %> diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index cff9c0a..94d29d6 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -1,5 +1,5 @@ <% throw_content :for_sidebar do -%> -
+

Popular Tags

<%= tag_cloud @tags %>
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index c9204a7..d0639b0 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -1,5 +1,5 @@ <% throw_content :for_sidebar do -%> -
+

Popular Tags

<%= tag_cloud @tags %>
diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 2eb5f7c..ce41a94 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -1,7 +1,7 @@ <% if @tags.empty? -%>

No tags were found!

<% else -%> -
+

All Tags in TuxBliki

<%= tag_cloud @tags -%>
diff --git a/public/stylesheets/content.css b/public/stylesheets/content.css index 210dfbc..8e47806 100644 --- a/public/stylesheets/content.css +++ b/public/stylesheets/content.css @@ -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;