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 67dd2ff..0ad8725 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 @@ -1,6 +1,19 @@ # encoding: UTF-8 namespace :software do + desc "Creates SISP software template" + task :create_sisp_template => :environment do + env = Environment.find_by_name("sisp") + + if env.present? + template = Community.where(identifier: "software", environment_id: env).last + template ||= Community.create!(name: "Software", identifier: "software", is_template: true, environment: env) + + template.boxes.find_by_position(1).blocks << StatisticBlock.new + template.save! + end + end + desc "Import sisp software from yml" task :import_sisp_from_yml => :environment do $imported_data = YAML.load_file('script/sisp-catalogo.yml') -- libgit2 0.21.2