Commit 8c6e1dba6fbedae02ea0c5ce829cd2b39cdd0c05
Committed by
Álvaro Fernando Matos de Souza
1 parent
940273be
Exists in
master
and in
5 other branches
Refactor categories group on software catalog
Signed-off-by: Arthur Jahn <stutrzbecher@gmail.com> Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
Showing
2 changed files
with
1 additions
and
15 deletions
Show diff stats
lib/ext/search_controller.rb
@@ -140,14 +140,6 @@ class SearchController | @@ -140,14 +140,6 @@ class SearchController | ||
140 | 140 | ||
141 | def prepare_software_infos_category_groups | 141 | def prepare_software_infos_category_groups |
142 | @categories = Category.software_categories.sort{|a, b| a.name <=> b.name} | 142 | @categories = Category.software_categories.sort{|a, b| a.name <=> b.name} |
143 | - @categories_groupe_one = [] | ||
144 | - @categories_groupe_two = [] | ||
145 | - | ||
146 | - if @categories && @categories.count > 1 | ||
147 | - categories_sliced = @categories.each_slice(@categories.count/2) | ||
148 | - @categories_groupe_one = categories_sliced.next | ||
149 | - @categories_groupe_two = categories_sliced.next | ||
150 | - end | ||
151 | end | 143 | end |
152 | 144 | ||
153 | def prepare_software_infos_category_enable | 145 | def prepare_software_infos_category_enable |
views/search/_catalog_filter.html.erb
@@ -4,18 +4,12 @@ | @@ -4,18 +4,12 @@ | ||
4 | <div id="filter-categories-catalog"><h4> <%= _("Categories") %> </h4></div> | 4 | <div id="filter-categories-catalog"><h4> <%= _("Categories") %> </h4></div> |
5 | <div id="group-categories"> | 5 | <div id="group-categories"> |
6 | <ul> | 6 | <ul> |
7 | - <% @categories_groupe_one.each do |category| %> | 7 | + <% @categories.each do |category| %> |
8 | <li> | 8 | <li> |
9 | <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> | 9 | <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> |
10 | <span><%= _("#{category.name}") %></span> | 10 | <span><%= _("#{category.name}") %></span> |
11 | </li> | 11 | </li> |
12 | <% end %> | 12 | <% end %> |
13 | - <% @categories_groupe_two.each do |category| %> | ||
14 | - <li> | ||
15 | - <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> | ||
16 | - <%= _("#{category.name}") %> | ||
17 | - </li> | ||
18 | - <% end %> | ||
19 | </ul> | 13 | </ul> |
20 | </div> | 14 | </div> |
21 | 15 |