diff --git a/src/noosfero-spb/software_communities/lib/categories_software_block.rb b/src/noosfero-spb/software_communities/lib/categories_software_block.rb index 97e1fda..1be800d 100644 --- a/src/noosfero-spb/software_communities/lib/categories_software_block.rb +++ b/src/noosfero-spb/software_communities/lib/categories_software_block.rb @@ -1,8 +1,10 @@ class CategoriesSoftwareBlock < Block attr_accessible :show_name + attr_accessible :search_catalog settings_items :show_name, :type => :boolean, :default => false + settings_items :search_catalog, :type => :string, :default => SearchController.catalog_list[:public_software].last def self.description _('Categories Softwares') diff --git a/src/noosfero-spb/software_communities/lib/ext/search_controller.rb b/src/noosfero-spb/software_communities/lib/ext/search_controller.rb index 6f50ea0..b0f3e75 100644 --- a/src/noosfero-spb/software_communities/lib/ext/search_controller.rb +++ b/src/noosfero-spb/software_communities/lib/ext/search_controller.rb @@ -2,6 +2,11 @@ require_dependency 'search_controller' class SearchController + def self.catalog_list + { :public_software => ["Software Público", "software_infos"], + :sisp_software => ["SISP", "sisp"] } + end + def communities delete_communities = [] valid_communities_string = Community.get_valid_communities_string diff --git a/src/noosfero-spb/software_communities/lib/search_catalog_block.rb b/src/noosfero-spb/software_communities/lib/search_catalog_block.rb index 4f7b517..64eafd4 100644 --- a/src/noosfero-spb/software_communities/lib/search_catalog_block.rb +++ b/src/noosfero-spb/software_communities/lib/search_catalog_block.rb @@ -1,8 +1,10 @@ class SearchCatalogBlock < Block attr_accessible :show_name + attr_accessible :search_catalog settings_items :show_name, :type => :boolean, :default => false + settings_items :search_catalog, :type => :string, :default => SearchController.catalog_list[:public_software].last def self.description _('Search Softwares catalog') diff --git a/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb b/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb index 6e914de..87b5daa 100644 --- a/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb +++ b/src/noosfero-spb/software_communities/views/blocks/categories_software.html.erb @@ -10,7 +10,7 @@ <% categories.each do |category| %> <% unless category.software_infos.count < 1 %> -
  • <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id]} %>
  • +
  • <%= link_to _("#{category.name}") + " (#{category.software_infos.count})", {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id]} %>
  • <% end %> <% end %> diff --git a/src/noosfero-spb/software_communities/views/blocks/search_catalog.html.erb b/src/noosfero-spb/software_communities/views/blocks/search_catalog.html.erb index bdbded1..c7995a9 100644 --- a/src/noosfero-spb/software_communities/views/blocks/search_catalog.html.erb +++ b/src/noosfero-spb/software_communities/views/blocks/search_catalog.html.erb @@ -1,11 +1,11 @@ diff --git a/src/noosfero-spb/software_communities/views/box_organizer/_categories_software_block.html.erb b/src/noosfero-spb/software_communities/views/box_organizer/_categories_software_block.html.erb new file mode 100644 index 0000000..453af14 --- /dev/null +++ b/src/noosfero-spb/software_communities/views/box_organizer/_categories_software_block.html.erb @@ -0,0 +1,6 @@ +
    + <% catalog_list = SearchController.catalog_list.collect{|i,v| v} %> + + + <%= select 'block', 'search_catalog', catalog_list %> +
    diff --git a/src/noosfero-spb/software_communities/views/box_organizer/_search_catalog_block.html.erb b/src/noosfero-spb/software_communities/views/box_organizer/_search_catalog_block.html.erb index 312b8d9..453af14 100644 --- a/src/noosfero-spb/software_communities/views/box_organizer/_search_catalog_block.html.erb +++ b/src/noosfero-spb/software_communities/views/box_organizer/_search_catalog_block.html.erb @@ -2,5 +2,5 @@ <% catalog_list = SearchController.catalog_list.collect{|i,v| v} %> - <%= select 'block', 'search_action', catalog_list %> + <%= select 'block', 'search_catalog', catalog_list %> -- libgit2 0.21.2