Set editable parts

This commit is contained in:
chris2tof 2011-06-01 15:49:55 +08:00
parent c7fc7084d5
commit dda4b30d67
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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 )

View File

@ -13,7 +13,7 @@
<r:snippet name='nav' />
</r:layout_part>
<r:layout_part name="main_content">
<r:layout_part name="main_content" editable="true">
</r:layout_part>
<r:layout_part name="footer">