Merge branch 'design_team' of https://github.com/Rulingcom/orbit into nccu_0509

Conflicts:
	app/controllers/admin/object_auths_new_interface_controller.rb
	app/helpers/application_helper.rb
	app/models/ad_banner.rb
This commit is contained in:
Matthew K. Fu JuYuan committed 2012-05-16 12:13:07 +08:00
commit a31a9c4792
169 files changed
+14400 -185

No files matched your search

+3
View File
@@ -9,5 +9,8 @@ class Asset
field :description
validates_presence_of :filename, :data
belongs_to :asset_category
belongs_to :assetable, polymorphic: true
end
+16
View File
@@ -0,0 +1,16 @@
class AssetCategory
include Mongoid::Document
include Mongoid::Timestamps
field :key
field :display
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
has_many :assets
def self.from_id(id)
AssetCategory.find(id) rescue nil
end
end
+11 -1
View File
@@ -2,10 +2,20 @@ class Link < Item
field :url
validates_presence_of :url
validates :url, :presence => true, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
before_validation :add_http
def link
ApplicationController.helpers.link_to(self.name, self.url)
end
protected
def add_http
unless self.url[/^http?s:\/\//]
self.url = 'http://' + self.url
end
end
end
+4
View File
@@ -1,10 +1,14 @@
class Page < Item
include Impressionist::Impressionable
is_impressionable :counter_cache => { :column_name => :view_count }
field :content
field :app_frontend_url
field :theme_id, :type => BSON::ObjectId, :default => nil
field :category
field :tag
field :view_count, :type => Integer, :default => 0
belongs_to :design
belongs_to :module_app