Commit cce16a6b2e0dbb8072488cf1cf42810b9d507a90
1 parent
823ea691
Exists in
sisp_simple_version
Minor changes o search catalog block to work with SISP
Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com> Signed-off-by: Tallys Martins <tallysmartins@yahoo.com.br>
Showing
7 changed files
with
19 additions
and
4 deletions
Show diff stats
src/noosfero-spb/software_communities/lib/categories_software_block.rb
1 | 1 | class CategoriesSoftwareBlock < Block |
2 | 2 | |
3 | 3 | attr_accessible :show_name |
4 | + attr_accessible :search_catalog | |
4 | 5 | |
5 | 6 | settings_items :show_name, :type => :boolean, :default => false |
7 | + settings_items :search_catalog, :type => :string, :default => SearchController.catalog_list[:public_software].last | |
6 | 8 | |
7 | 9 | def self.description |
8 | 10 | _('Categories Softwares') | ... | ... |
src/noosfero-spb/software_communities/lib/ext/search_controller.rb
... | ... | @@ -2,6 +2,11 @@ require_dependency 'search_controller' |
2 | 2 | |
3 | 3 | class SearchController |
4 | 4 | |
5 | + def self.catalog_list | |
6 | + { :public_software => ["Software Público", "software_infos"], | |
7 | + :sisp_software => ["SISP", "sisp"] } | |
8 | + end | |
9 | + | |
5 | 10 | def communities |
6 | 11 | delete_communities = [] |
7 | 12 | valid_communities_string = Community.get_valid_communities_string | ... | ... |
src/noosfero-spb/software_communities/lib/search_catalog_block.rb
1 | 1 | class SearchCatalogBlock < Block |
2 | 2 | |
3 | 3 | attr_accessible :show_name |
4 | + attr_accessible :search_catalog | |
4 | 5 | |
5 | 6 | settings_items :show_name, :type => :boolean, :default => false |
7 | + settings_items :search_catalog, :type => :string, :default => SearchController.catalog_list[:public_software].last | |
6 | 8 | |
7 | 9 | def self.description |
8 | 10 | _('Search Softwares catalog') | ... | ... |
src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | |
11 | 11 | <% categories.each do |category| %> |
12 | 12 | <% unless category.software_infos.count < 1 %> |
13 | - <li><%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id]} %></li> | |
13 | + <li><%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id]} %></li> | |
14 | 14 | <% end %> |
15 | 15 | <% end %> |
16 | 16 | </ul> | ... | ... |
src/noosfero-spb/software_communities/views/blocks/search_catalog.html.erb
1 | 1 | <div id="catalogo-software-search"> |
2 | 2 | <h1><%= _("Catalog of Software") %></h1> |
3 | - <%= form_tag(controller: "search", action: "software_infos", method: "get") do %> | |
3 | + <%= form_tag(controller: "search", action: block.search_catalog, method: "get") do %> | |
4 | 4 | <%= text_field_tag(:query, nil, :placeholder => "e.g: cacic, e-cidade, gsan, etc", :class=>"searchField", :id=>"search-Gadget") %> |
5 | 5 | <%= submit_tag(_("Search"), {:class=>"searchButton-catalog"})%> |
6 | 6 | <% end %> |
7 | 7 | |
8 | 8 | <div id="search-catalog-footer"> |
9 | - <p><%= link_to _("Access the complete catalog"), {controller: "search", action: "software_infos"} , {:id => "bt_catalog-search"}%></p> | |
9 | + <p><%= link_to _("Access the complete catalog"), {controller: "search", action: block.search_catalog} , {:id => "bt_catalog-search"}%></p> | |
10 | 10 | </div> |
11 | 11 | </div> | ... | ... |
src/noosfero-spb/software_communities/views/box_organizer/_categories_software_block.html.erb
0 → 100644
src/noosfero-spb/software_communities/views/box_organizer/_search_catalog_block.html.erb