Commit a2034e10873863cb861102a2d408230fd79b4722

Authored by Gabriela Navarro
1 parent 325689ad

Overall fixes:

- Search controller to only show communities
  - Translation from search catalog

Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
lib/ext/search_controller.rb
@@ -7,7 +7,12 @@ class SearchController @@ -7,7 +7,12 @@ class SearchController
7 full_text_search 7 full_text_search
8 results = @searches[@asset][:results] 8 results = @searches[@asset][:results]
9 9
10 - results = results.each {|community| !community.software? and !community.institution?} 10 + communities = []
  11 + results.find_each do |community|
  12 + communities << community if (!community.software? and !community.institution?)
  13 + end
  14 +
  15 + results = communities.paginate(:per_page => 24, :page => params[:page])
11 @searches[@asset] = {:results => results} 16 @searches[@asset] = {:results => results}
12 @search = results 17 @search = results
13 end 18 end
po/pt/software_communities.po
@@ -1091,7 +1091,7 @@ msgid &quot;&quot; @@ -1091,7 +1091,7 @@ msgid &quot;&quot;
1091 "Type words about the software_info you're looking for (the search begins " 1091 "Type words about the software_info you're looking for (the search begins "
1092 "after 3 characters)" 1092 "after 3 characters)"
1093 msgstr "Digite palavras sobre o software que você está procurando (a busca " 1093 msgstr "Digite palavras sobre o software que você está procurando (a busca "
1094 -"automática começa após 3 letras") 1094 +"automática começa após 3 letras)"
1095 1095
1096 #: plugins/software_communities/views/search/_software_search_form.html.erb:18 1096 #: plugins/software_communities/views/search/_software_search_form.html.erb:18
1097 msgid "Filter" 1097 msgid "Filter"
test/functional/search_controller_test.rb
@@ -75,6 +75,7 @@ class SearchControllerTest &lt; ActionController::TestCase @@ -75,6 +75,7 @@ class SearchControllerTest &lt; ActionController::TestCase
75 75
76 community_template = create_community("New Community Template") 76 community_template = create_community("New Community Template")
77 community_template.is_template = true 77 community_template.is_template = true
  78 + community_template.visible = false
78 community_template.save! 79 community_template.save!
79 80
80 get :communities, :query => "New" 81 get :communities, :query => "New"