From eaa766f9102e78ef0ceb10efd5e94243fe4962d6 Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Thu, 27 Nov 2014 17:03:34 +0000 Subject: [PATCH] Show categories and tags only if they exists in software --- views/blocks/categories_and_tags.html.erb | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/views/blocks/categories_and_tags.html.erb b/views/blocks/categories_and_tags.html.erb index 24f9c9f..a476fbf 100644 --- a/views/blocks/categories_and_tags.html.erb +++ b/views/blocks/categories_and_tags.html.erb @@ -1,14 +1,19 @@ -

<%= _("Categories") %>

+<% if block.owner.categories.count > 0 %> +

<%= _("Categories") %>

-
-<% block.owner.categories.each do |category| %> - <%= link_to category.name , category.path, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %> +
+ <% block.owner.categories.each do |category| %> + <%= link_to category.name , category.path, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %> + <% end %> +
<% end %> -
-

<%= _("Tags") %>

-
-<% block.owner.tag_list.each do |tag| %> - <%= link_to tag , "#", :id => "select-category-1-link", :class => "select-subcategory-link"%> -<% end %> -
\ No newline at end of file +<% if block.owner.tag_list.count > 0 %> +

<%= _("Tags") %>

+ +
+ <% block.owner.tag_list.each do |tag| %> + <%= link_to tag , "#", :id => "select-category-1-link", :class => "select-subcategory-link"%> + <% end %> +
+<% end %> \ No newline at end of file -- libgit2 0.21.2