Commit a1e300f3a142d60dc4f06257303e51fb4a59c726

Authored by Gabriela Navarro
1 parent 9a786d8f

Only show categories that have softwares related to

Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
views/blocks/categories_software.html.erb
@@ -15,7 +15,9 @@ @@ -15,7 +15,9 @@
15 <ul class="categories-mais-software"> 15 <ul class="categories-mais-software">
16 16
17 <% Category.where(:name => "Software").first.children.each do |category| %> 17 <% Category.where(:name => "Software").first.children.each do |category| %>
18 - <li><%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories => [category.id]} %></li> 18 + <% unless category.software_infos.count < 1 %>
  19 + <li><%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories => [category.id]} %></li>
  20 + <% end %>
19 <% end %> 21 <% end %>
20 </ul> 22 </ul>
21 </div> 23 </div>
@@ -23,4 +25,4 @@ @@ -23,4 +25,4 @@
23 <div id="footer-mais-software"> 25 <div id="footer-mais-software">
24 <%= link_to _("Access the complete catalog"), {controller: "search", action: "software_infos"}%> 26 <%= link_to _("Access the complete catalog"), {controller: "search", action: "software_infos"}%>
25 </div> 27 </div>
26 -</div>  
27 \ No newline at end of file 28 \ No newline at end of file
  29 +</div>