aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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