diff --git a/app/models/design/layout.rb b/app/models/design/layout.rb index dae1c43b0..e27ca0bbc 100644 --- a/app/models/design/layout.rb +++ b/app/models/design/layout.rb @@ -12,7 +12,7 @@ class Layout < DesignFile after_save :parse_layout def content - self.file.read.force_encoding("UTF-8") + self.file.read.force_encoding("UTF-8") rescue '' end def self.exist_one? diff --git a/app/models/purchase/purchase.rb b/app/models/purchase/purchase.rb index 760724a27..cc52c2d50 100644 --- a/app/models/purchase/purchase.rb +++ b/app/models/purchase/purchase.rb @@ -6,6 +6,6 @@ class Purchase field :title field :author field :intro - field :downloaded + field :downloaded, :type => Boolean end diff --git a/app/views/admin/pages/_form.html.erb b/app/views/admin/pages/_form.html.erb index 19e7c1a64..845e4d378 100644 --- a/app/views/admin/pages/_form.html.erb +++ b/app/views/admin/pages/_form.html.erb @@ -25,7 +25,7 @@
<%= t('admin.theme') %> <% if @design %> - <%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }%> + <%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %> <% else %> <%= f.select :theme_id, @default_design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %> <% end %> diff --git a/lib/parser.rb b/lib/parser.rb index 3eddbdca8..51e3e2730 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -113,7 +113,7 @@ module Parser def parse_page(page) if page._type == 'Page' - layout_content = page.design.layout.content.force_encoding('UTF-8') + layout_content = page.design.layout.content.force_encoding('UTF-8') rescue '' context = parser_context(page) parser = Radius::Parser.new(context, :tag_prefix => 'r') parser.parse(parser.parse(layout_content)) @@ -122,7 +122,7 @@ module Parser def parse_page_edit(page) if page._type == 'Page' - layout_content = page.design.layout.content.force_encoding('UTF-8') + layout_content = page.design.layout.content.force_encoding('UTF-8') rescue '' context = parser_context_edit(page) parser = Radius::Parser.new(context, :tag_prefix => 'r') parser.parse(parser.parse(layout_content)) @@ -175,8 +175,8 @@ module Parser end c.define_tag 'stylesheets' do |tag| res = '' - res << "" - res << "" + res << "" if page.design.reset_css + res << "" if page.design.default_css theme = page.design.themes.detect{ |d| d.id == page.theme_id } res << "" if theme res diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake index 36b6952a8..0ccb41771 100644 --- a/lib/tasks/dev.rake +++ b/lib/tasks/dev.rake @@ -81,9 +81,9 @@ namespace :dev do design.build_layout design.layout.file = File.open("#{Rails.root}/lib/fraisier/layout.html") - design.layout - theme - theme_1 + design.layout.save + theme.save + theme_1.save # image.save # js.save @@ -105,9 +105,9 @@ namespace :dev do design_1.build_layout design_1.layout.file = File.open("#{Rails.root}/lib/fraisier/layout.html") - design_1.layout - theme - theme_1 + design_1.layout.save + theme.save + theme_1.save # image.save # js.save