aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/blog
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2011-02-21 13:24:31 +1300
committerPhilip Arndt <parndt@gmail.com>2011-02-21 13:24:31 +1300
commitce9c66363123a5353580113145e6372433feaa25 (patch)
treece8fa8af05dff254a8a545c11ebce0af2f2d6b20 /app/views/blog
parentf221da62cde073059424eddaa1f7a52ed67de848 (diff)
downloadrefinerycms-blog-ce9c66363123a5353580113145e6372433feaa25.tar.gz
refinerycms-blog-ce9c66363123a5353580113145e6372433feaa25.tar.bz2
refinerycms-blog-ce9c66363123a5353580113145e6372433feaa25.zip
Only show these sections when there is relevant information to show.
Diffstat (limited to 'app/views/blog')
-rw-r--r--app/views/blog/shared/_categories.html.erb18
-rw-r--r--app/views/blog/shared/_posts.html.erb18
2 files changed, 20 insertions, 16 deletions
diff --git a/app/views/blog/shared/_categories.html.erb b/app/views/blog/shared/_categories.html.erb
index 675271c..05cc53f 100644
--- a/app/views/blog/shared/_categories.html.erb
+++ b/app/views/blog/shared/_categories.html.erb
@@ -1,8 +1,10 @@
-<h2><%= t('.title') %></h2>
-<ul id='categories'>
- <% @blog_categories.each do |category| %>
- <li<%= " class='selected'" if @category.present? and @category.id == category.id %>>
- <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %>
- </li>
- <% end %>
-</ul>
+<% if @blog_categories.any? %>
+ <h2><%= t('.title') %></h2>
+ <ul id='categories'>
+ <% @blog_categories.each do |category| %>
+ <li<%= " class='selected'" if @category.present? and @category.id == category.id %>>
+ <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %>
+ </li>
+ <% end %>
+ </ul>
+<% end %> \ No newline at end of file
diff --git a/app/views/blog/shared/_posts.html.erb b/app/views/blog/shared/_posts.html.erb
index cbf865f..24a8199 100644
--- a/app/views/blog/shared/_posts.html.erb
+++ b/app/views/blog/shared/_posts.html.erb
@@ -1,8 +1,10 @@
-<h2><%= t('.other') %></h2>
-<ul id="blog_posts">
- <% @blog_posts.each do |blog_post| %>
- <li class='clearfix'>
- <%= link_to blog_post.title, blog_post_url(blog_post) %>
- </li>
- <% end %>
-</ul>
+<% if @blog_posts.many? %>
+ <h2><%= t('.other') %></h2>
+ <ul id="blog_posts">
+ <% @blog_posts.each do |blog_post| %>
+ <li class='clearfix'>
+ <%= link_to blog_post.title, blog_post_url(blog_post) %>
+ </li>
+ <% end %>
+ </ul>
+<% end %> \ No newline at end of file