gallery options

This commit is contained in:
Fu Matthew committed 2012-12-28 15:30:46 +08:00
1 parent 2a122c7f5c
commit baf1240b76
15 files changed
+66 -17

No files matched your search

+11 -2
View File
@@ -12,12 +12,13 @@ class ModuleApp
field :update_info
field :create_date
field :enable_frontend, type: Boolean, :default => true
field :app_pages ,type: Array
# field :widgets ,type: Array
field :widgets ,type: Hash
field :widget_fields ,type: Array
field :widget_options,type:Hash
field :widget_options_fields_i18n,type:Hash
has_many :managers,as: :managing_app ,:class_name => "AppManager" ,:dependent => :destroy#,:foreign_key => "managing_app_id",:inverse_of => :managing_app
has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager", :dependent => :destroy#,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app
@@ -79,6 +80,14 @@ class ModuleApp
end
end
def needs_to_widget_option?
if self.widget_options
self.widget_options.has_key? widgets.first
else
false
end
end
protected
def set_key
+7
View File
@@ -14,6 +14,7 @@ class PagePart
field :widget_style
field :widget_field , :type => Array
field :widget_options ,:type=>Hash
field :widget_data_count
belongs_to :page
@@ -22,6 +23,11 @@ class PagePart
before_save :delete_empty_widget_field
after_save :update_parent
def widget_options_uri
self.widget_options.map{|t| "#{t[0]}: #{t[1]}"}.join(',') rescue ''
end
protected
def delete_empty_widget_field
@@ -35,4 +41,5 @@ class PagePart
self.page.save
end
end