Merge branch 'rails_3_1' of github.com:Rulingcom/orbit into rails_3_1

This commit is contained in:
chris2tof 2011-08-25 16:04:47 +08:00
commit 983c86e653
4 changed files with 13 additions and 15 deletions

View File

@ -22,7 +22,7 @@ class Admin::PagesController < ApplicationController
@item.is_published = true @item.is_published = true
@item.parent_id = @parent_item.id rescue nil @item.parent_id = @parent_item.id rescue nil
@designs = Design.all.entries @designs = Design.all.entries
@default_design = @designs.detect {|d| d.title.to_s == 'Bob' } @default_design = Design.first
@default_theme = @default_design.themes.detect {|t| t.name.to_s == 'default' } @default_theme = @default_design.themes.detect {|t| t.name.to_s == 'default' }
end end

View File

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

View File

@ -16,8 +16,10 @@ test:
# set these environment variables on your prod server # set these environment variables on your prod server
production: production:
host: <%= ENV['MONGOID_HOST'] %> # host: <%= ENV['MONGOID_HOST'] %>
port: <%= ENV['MONGOID_PORT'] %> # port: <%= ENV['MONGOID_PORT'] %>
username: <%= ENV['MONGOID_USERNAME'] %> # username: <%= ENV['MONGOID_USERNAME'] %>
password: <%= ENV['MONGOID_PASSWORD'] %> # password: <%= ENV['MONGOID_PASSWORD'] %>
database: <%= ENV['MONGOID_DATABASE'] %> # database: <%= ENV['MONGOID_DATABASE'] %>
<<: *defaults
database: prototype_r4_development

View File

@ -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,11 +169,9 @@ 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 end
res
end
c.define_tag 'javascripts' do |tag| c.define_tag 'javascripts' do |tag|
res = '' res = ''
page.design.javascripts.each do |js| page.design.javascripts.each do |js|