Set editable parts
This commit is contained in:
parent
c7fc7084d5
commit
dda4b30d67
|
@ -14,7 +14,7 @@ class Page < Item
|
||||||
def create_parts
|
def create_parts
|
||||||
page_layout = self.get_layout
|
page_layout = self.get_layout
|
||||||
page_layout.layout_parts.each do |p|
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -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.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 => '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 )
|
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 )
|
home = Page.create!( :i18n_variable_id => var_10.id, :layout_id => layout.id, :name => 'home', :is_published => true )
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<r:snippet name='nav' />
|
<r:snippet name='nav' />
|
||||||
</r:layout_part>
|
</r:layout_part>
|
||||||
|
|
||||||
<r:layout_part name="main_content">
|
<r:layout_part name="main_content" editable="true">
|
||||||
</r:layout_part>
|
</r:layout_part>
|
||||||
|
|
||||||
<r:layout_part name="footer">
|
<r:layout_part name="footer">
|
||||||
|
|
Reference in New Issue