orbit-basic/lib/tasks/site.rake

52 lines
4.6 KiB
Ruby
Raw Normal View History

2011-08-18 05:43:33 +00:00
# encoding: utf-8
namespace :site do
task :build => :environment do
2013-02-05 10:26:45 +00:00
Site.destroy_all
Purchase.destroy_all
2013-05-14 03:26:35 +00:00
Site.create( :school => 'RulingDigital University', :department => 'Computer Science', :valid_locales => [ 'en', 'zh_tw' ], :in_use_locales => [ 'zh_tw', 'en' ])
User.create!(:email=>'chris@rulingcom.com',:admin=>true,:user_id=>'chris',:password=>'password')
2013-05-14 03:26:35 +00:00
`mongo #{Mongoid.config.database.name} --eval "db.fs.chunks.ensureIndex({files_id: 1, n: 1})"`
puts "Congres you can now login within url"
puts 'Please upload design package (/admin/designs/upload_package ) and run rake site:necessary_data'
2013-05-14 03:48:13 +00:00
I18nVariable.create!( :document_class => 'language', :key => 'en', :en => 'English', :zh_tw => '英文' )
I18nVariable.create!( :document_class => 'language', :key => 'zh_tw', :en => 'Chinese', :zh_tw => '中文' )
Info.create!(key: "profile", built_in: true, disabled: false, title: {"zh_tw"=>"基本欄位", "en"=>"Basic Info"}, to_search: false)
2011-08-18 05:43:33 +00:00
end
task :necessary_data => :environment do
site = Site.first
site.title = 'RulingOrbit Demo Site'
site.save
# home_trans = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
design = Design.first
site = Site.first
site.design = design
site.terms_of_use_translations = {"en"=>"1. The copyright of the documents in this web site is belonged to RulingDigital Inc.. It is free for non-commercial use and required to register the source “RulingDigital Inc.”. 2. Documents specified above follow the rules of separate authorization regulations.
3. We will make every effort to ensure that the data of the web pages is immediate and correct but it cannot guarantee any responsibilities. We have the authorities to change the contents of the web pages without notice in advance. Therefore, please contact the people who are in charge to make sure whatever you may concern, like the date or qualification of the tests.
4. The web site is free of any software virus but not guaranteed. We are not responsible for any loss or damage however caused by the downloaded data from this web.
5. Hyperlinks to other websites are provided as a convenience only, and imply neither responsibility for, nor approval of, the information contained in those other web sites.
6. This web site does not use cookies and also not track individual visitors to our web site. If you provide personally identifiable information about yourself, we will not use the information for any purpose other than to respond to your inquiry.
7. The revision of the regulations is not notified in advance. Any user who has opinions or suggestions to the rules of this website, please contact the webmaster.",
"zh_tw"=>"1. 本網站所刊載資料之著作權,除另有規定外,屬於 銳綸數位股份有限公司(下稱「本單位」)。任何人得為非營利目的自由使用。但使用時,不得變更其內容、詆毀或減損本單位名譽,且必須註明來源為「銳綸數位股份有限公司」。
2. 使使
3. 使
4.
5. 使便
6. 使 cookies 使使使使
7. 使使"}
site.save
theme = design.themes.first
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
home.save
end
2011-08-18 05:43:33 +00:00
end