diff --git a/src/noosfero-spb/gov_user/lib/public_institution.rb b/src/noosfero-spb/gov_user/lib/public_institution.rb index 142852b..8f9dd6a 100644 --- a/src/noosfero-spb/gov_user/lib/public_institution.rb +++ b/src/noosfero-spb/gov_user/lib/public_institution.rb @@ -2,8 +2,6 @@ class PublicInstitution < Institution validates :governmental_power, :governmental_sphere, :juridical_nature, :presence=>true - validates :acronym, :allow_blank => true, :allow_nil => true - validates :cnpj, :format => {with: CNPJ_FORMAT}, :unless => 'cnpj.blank?' diff --git a/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css b/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css index 02879d9..e607bf9 100644 --- a/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css +++ b/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css @@ -628,9 +628,9 @@ .action-search-sisp #filter-catalog-software #filter-categories-option { border: none; height: 0; - max-height: 620px; + max-height: auto; position: relative; - overflow: hidden; + overflow: auto; padding: 0 15px; } 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 1be800d..9d39303 100644 --- a/src/noosfero-spb/software_communities/lib/categories_software_block.rb +++ b/src/noosfero-spb/software_communities/lib/categories_software_block.rb @@ -19,7 +19,7 @@ class CategoriesSoftwareBlock < Block block = self s = show_name - software_category = Category.find_by_name("Software") + software_category = environment.categories.find_by_name("Software") categories = [] categories = software_category.children.sort if software_category 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 bc20388..db4f8d7 100644 --- a/src/noosfero-spb/software_communities/lib/ext/search_controller.rb +++ b/src/noosfero-spb/software_communities/lib/ext/search_controller.rb @@ -177,7 +177,9 @@ class SearchController end def prepare_software_infos_category_groups &software_condition_block - @categories = Category.software_categories + @categories = [] + software_category = environment.categories.find_by_name("Software") + @categories = software_category.children.sort if software_category @categories = @categories.select{|category| category.software_infos.any?{|software| software_condition_block.call(software)}} @categories.sort!{|a, b| a.name <=> b.name} end diff --git a/src/noosfero-spb/software_communities/lib/tasks/create_categories.rake b/src/noosfero-spb/software_communities/lib/tasks/create_categories.rake index 29a1cf9..b5714b9 100644 --- a/src/noosfero-spb/software_communities/lib/tasks/create_categories.rake +++ b/src/noosfero-spb/software_communities/lib/tasks/create_categories.rake @@ -4,9 +4,9 @@ namespace :software do Environment.all.each do |env| if env.plugin_enabled?("SoftwareCommunitiesPlugin") or env.plugin_enabled?("SoftwareCommunities") print 'Creating categories: ' - software = Category.create(:name => _("Software"), :environment => env) + software = env.categories.find_or_create_by_name(_("Software")) Category::SOFTWARE_CATEGORIES.each do |category_name| - unless Category.find_by_name(category_name) + unless env.categories.find_by_name(category_name) print '.' Category.create(:name => category_name, :environment => env, :parent => software) else diff --git a/src/noosfero-spb/software_communities/lib/tasks/import_sisp_software.rake b/src/noosfero-spb/software_communities/lib/tasks/import_sisp_software.rake index f5dd938..0d6ce71 100755 --- a/src/noosfero-spb/software_communities/lib/tasks/import_sisp_software.rake +++ b/src/noosfero-spb/software_communities/lib/tasks/import_sisp_software.rake @@ -86,7 +86,7 @@ namespace :sisp do $imported_data = YAML.load_file('plugins/software_communities/public/static/sisp-catalog.yml') $env = Environment.find_by_name("SISP") - $software_category = Category.find_or_create_by_name("Software") + $software_category = $env.categories.find_or_create_by_name("Software") $software_category.environment = $env $software_category.save! -- libgit2 0.21.2