From dda4b30d6787851141472c1128162133db5b5976 Mon Sep 17 00:00:00 2001 From: chris2tof Date: Wed, 1 Jun 2011 15:49:55 +0800 Subject: [PATCH] Set editable parts --- app/models/page.rb | 2 +- lib/tasks/dev.rake | 2 +- lib/template/root.layout | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 3c7ffb67..726809f5 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -14,7 +14,7 @@ class Page < Item def create_parts page_layout = self.get_layout page_layout.layout_parts.each do |p| - self.page_parts.create( :name => p.name, :i18n_variable_id => I18nVariable.create.id, :kind => 'text' ) + self.page_parts.create( :name => p.name, :i18n_variable_id => I18nVariable.create.id, :kind => 'text' ) if p['editable'] end end diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake index 7964767c..63f6fae8 100644 --- a/lib/tasks/dev.rake +++ b/lib/tasks/dev.rake @@ -52,7 +52,7 @@ namespace :dev do layout = Layout.create!( :name => 'root', :description => 'root', :content => File.open("#{RAILS_ROOT}/lib/template/root.layout").read ) layout.layout_parts.create!( :name => 'header', :content => File.open("#{RAILS_ROOT}/lib/template/nav.snippet").read ) - layout.layout_parts.create!( :name => 'main_content' ) + layout.layout_parts.create!( :name => 'main_content', :editable => true ) layout.layout_parts.create!( :name => 'footer', :content => File.open("#{RAILS_ROOT}/lib/template/footer.snippet").read ) home = Page.create!( :i18n_variable_id => var_10.id, :layout_id => layout.id, :name => 'home', :is_published => true ) diff --git a/lib/template/root.layout b/lib/template/root.layout index 6646d6ca..08d16bb4 100644 --- a/lib/template/root.layout +++ b/lib/template/root.layout @@ -13,7 +13,7 @@ - +