Commit 431b4eb6261b1897c34d443633a9bb36dea71213

Authored by Tallys Martins
1 parent 4078ca33

Add custom catalog to categories and tags block

Signed-off-by: Omar Junior <omarroinuj@gmail.com>
Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com>
Signed-off-by: Tallys Martins <tallysmartins@yahoo.com.br>
src/noosfero-spb/software_communities/lib/categories_and_tags_block.rb
1 class CategoriesAndTagsBlock < Block 1 class CategoriesAndTagsBlock < Block
2 2
3 attr_accessible :show_name 3 attr_accessible :show_name
  4 + attr_accessible :search_catalog
4 5
5 settings_items :show_name, :type => :boolean, :default => false 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 def self.description 9 def self.description
8 _('Categories and Tags') 10 _('Categories and Tags')
src/noosfero-spb/software_communities/views/blocks/categories_and_tags.html.erb
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 3
4 <div class="category_cloud"> 4 <div class="category_cloud">
5 <% block.owner.categories.each do |category| %> 5 <% block.owner.categories.each do |category| %>
6 - <%= link_to category.name, {:controller => :search, :action => :software_infos, :selected_categories_id => [category.id], :software_type => 'all'}, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %> 6 + <%= link_to category.name, {:controller => :search, :action => block.search_catalog, :selected_categories_id => [category.id], :software_type => 'all'}, :id => "select-category-1-link", :class => "select-subcategory-link", :target => "_blank" %>
7 <% end %> 7 <% end %>
8 </div><!-- end class='category_cloud' --> 8 </div><!-- end class='category_cloud' -->
9 <% end %> 9 <% end %>
src/noosfero-spb/software_communities/views/box_organizer/_categories_and_tags_block.html.erb 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +<div id='edit-search-block' class="formfieldline">
  2 + <% catalog_list = SearchController.catalog_list.collect{|i,v| v} %>
  3 +
  4 + <label class="formlabel"><%= _("Catalog: ") %></label>
  5 + <%= select 'block', 'search_catalog', catalog_list %>
  6 +</div>