diff options
Diffstat (limited to 'app/views/blog/shared')
-rw-r--r-- | app/views/blog/shared/_post.html.erb | 10 | ||||
-rw-r--r-- | app/views/blog/shared/_tags.html.erb | 8 |
2 files changed, 15 insertions, 3 deletions
diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb index 2e92f73..716c1ad 100644 --- a/app/views/blog/shared/_post.html.erb +++ b/app/views/blog/shared/_post.html.erb @@ -9,9 +9,13 @@ <% if (categories = post.categories).any? %> <aside class='filed_in'> <%= t('filed_in', :scope => 'blog.posts.show') %> - <% categories.each_with_index do |category, index| %> - <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %> - <% end %> + <%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %> + </aside> + <% end %> + <% if (tags = post.tag_list).any? %> + <aside class='tagged'> + <%= t('tagged', :scope => 'blog.posts.show') %> + <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.parameterize) }.to_sentence %> </aside> <% end %> </details> diff --git a/app/views/blog/shared/_tags.html.erb b/app/views/blog/shared/_tags.html.erb new file mode 100644 index 0000000..f8833f1 --- /dev/null +++ b/app/views/blog/shared/_tags.html.erb @@ -0,0 +1,8 @@ +<% unless @tags.nil? %> + <h2><%= t('.title') %></h2> + <nav id='tags'> + <% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %> + <%= link_to tag.name, tagged_posts_path(tag.name.parameterize), :class => css_class %> + <% end %> + </nav> +<% end %>
\ No newline at end of file |