Commit 8255ef575b18b8cc57666820844b7bcf5a56d8a8

Authored by Arthur Esposte
1 parent fcebf737

Add home page creation in main task

Showing 1 changed file with 16 additions and 0 deletions   Show diff stats
lib/tasks/main_data.rake
... ... @@ -49,6 +49,21 @@ namespace :main_data do
49 49 generate_article(community, TinyMceArticle, {name: "Publique seu software", slug: "publique-seu-software", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false})
50 50 generate_article(community, TinyMceArticle, {name: "Inicie um projeto", slug: "inicie-um-projeto", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false})
51 51 generate_article(community, TinyMceArticle, {name: "Entenda o que é", slug: "entenda-o-que-e", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false})
  52 + generate_article(community, TinyMceArticle, {name: "Ajuda", slug: "ajuda", published: true, accept_comments: false, notify_comments: true, license_id: 1, body: "", accept_comments: false})
  53 + end
  54 + end
  55 + end
  56 +
  57 + desc "Create the home page blocks"
  58 + task :home => :environment do
  59 + Environment.all.each do |env|
  60 + if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("MpogSoftwarePlugin")
  61 + identifier = "spb"
  62 +
  63 + box2 = env.boxes.where(:position => 2).first
  64 + box2.blocks.destroy_all
  65 +
  66 + generate_fixed_blocks(env)
52 67 end
53 68 end
54 69 end
... ... @@ -122,6 +137,7 @@ namespace :main_data do
122 137  
123 138 third_link_list_block.links << {:icon => "no-icon", :name => "Catálogo de Software Público", :address => "/search/software_infos", :target => "_self"}
124 139 third_link_list_block.links << {:icon => "no-icon", :name => "Comunidades", :address => "/search/communities", :target => "_self"}
  140 + third_link_list_block.links << {:icon => "no-icon", :name => "Ajuda", :address => "/#{identifier}/ajuda", :target => "_self"}
125 141  
126 142 third_link_list_block.save!
127 143 box2.blocks << third_link_list_block
... ...