Fix bug when selecting theme
This commit is contained in:
parent
32849f1d1b
commit
8b576cac48
|
@ -1,7 +1,7 @@
|
||||||
class Page < Item
|
class Page < Item
|
||||||
|
|
||||||
field :content
|
field :content
|
||||||
field :theme_id
|
field :theme_id, :type => BSON::ObjectId
|
||||||
|
|
||||||
belongs_to :design
|
belongs_to :design
|
||||||
has_many :page_parts
|
has_many :page_parts
|
||||||
|
|
|
@ -66,10 +66,8 @@ module Parser
|
||||||
c.define_tag 'stylesheets' do |tag|
|
c.define_tag 'stylesheets' do |tag|
|
||||||
res = ''
|
res = ''
|
||||||
res << "<link href='#{page.design.structure_css.url}' rel='stylesheet' type='text/css' /> "
|
res << "<link href='#{page.design.structure_css.url}' rel='stylesheet' type='text/css' /> "
|
||||||
page.design.themes.each do |theme|
|
theme = page.design.themes.detect{ |d| d.id == page.theme_id }
|
||||||
res << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' /> "
|
res << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />"
|
||||||
end
|
|
||||||
res
|
|
||||||
end
|
end
|
||||||
c.define_tag 'javascripts' do |tag|
|
c.define_tag 'javascripts' do |tag|
|
||||||
res = ''
|
res = ''
|
||||||
|
@ -171,10 +169,8 @@ module Parser
|
||||||
c.define_tag 'stylesheets' do |tag|
|
c.define_tag 'stylesheets' do |tag|
|
||||||
res = ''
|
res = ''
|
||||||
res << "<link href='#{page.design.structure_css.url}' rel='stylesheet' type='text/css' />"
|
res << "<link href='#{page.design.structure_css.url}' rel='stylesheet' type='text/css' />"
|
||||||
page.design.themes.each do |theme|
|
theme = page.design.themes.detect{ |d| d.id == page.theme_id }
|
||||||
res << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />"
|
res << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />"
|
||||||
end
|
|
||||||
res
|
|
||||||
end
|
end
|
||||||
c.define_tag 'javascripts' do |tag|
|
c.define_tag 'javascripts' do |tag|
|
||||||
res = ''
|
res = ''
|
||||||
|
|
Loading…
Reference in New Issue