diff --git a/lib/ext/search_controller.rb b/lib/ext/search_controller.rb index 6fbd75a..145da2f 100644 --- a/lib/ext/search_controller.rb +++ b/lib/ext/search_controller.rb @@ -11,13 +11,13 @@ class SearchController def software_infos @titles[:software_infos] = "Software Infos" + @category_filters = [] if params[:filter].blank? results = filter_communities_list{|community| community.software?} else - integer_filters = [] - params[:filter].split(",").each{|f| integer_filters << f.to_i} - results = filter_communities_list{|community| community.software? && !(community.category_ids & integer_filters).blank?} + params[:filter].split(",").each{|f| @category_filters << f.to_i} + results = filter_communities_list{|community| community.software? && !(community.category_ids & @category_filters).blank?} end results = results.paginate(:per_page => 24, :page => params[:page]) diff --git a/public/software-catalog.js b/public/software-catalog.js index 8e2652b..1025b5b 100644 --- a/public/software-catalog.js +++ b/public/software-catalog.js @@ -9,10 +9,8 @@ function create_catalog_element(first, value, id) { var li_tag = document.createElement("li"); - if( first ) - li_tag.innerHTML = value + " x"; - else - li_tag.innerHTML = ", " + value + " x"; + li_tag.className = "category_box"; + li_tag.innerHTML = value + " x"; return li_tag; } @@ -88,12 +86,7 @@ jQuery(".catalog-remove-item").click(remote_catalog_item); } - function clear_filters() { - jQuery("#filter").val(""); - } - jQuery(document).ready(function(){ - clear_filters(); set_autocomplate(); set_events(); }); diff --git a/views/search/_catalog_filter.html.erb b/views/search/_catalog_filter.html.erb index d8b6d88..3ab9c52 100644 --- a/views/search/_catalog_filter.html.erb +++ b/views/search/_catalog_filter.html.erb @@ -1,34 +1,51 @@ +
-
- -
+
+ +
-
- <%= text_field(:software, :catalog, :id=>"software-catalog") %> -
+
+ <%= text_field(:software, :catalog, :id=>"software-catalog") %> +
\ No newline at end of file -- libgit2 0.21.2