demo widget

This commit is contained in:
unknown authored and Christophe Vilayphiou committed 2012-07-18 18:07:45 +08:00
1 parent e48735a4ac
commit 10731dc211
12 files changed
+675 -24

No files matched your search

+2 -1
View File
@@ -14,7 +14,8 @@ class ModuleApp
field :enable_frontend, type: Boolean, :default => true
field :app_pages ,type: Array
field :widgets ,type: Array
# field :widgets ,type: Array
field :widgets ,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
+2
View File
@@ -10,6 +10,8 @@ class PagePart
field :public_r_tag_object_id, :default => nil
field :public_r_tag_option, :default => nil
field :widget_path
field :widget_style
field :widget_data_count
has_one :i18n_variable, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
@@ -15,6 +15,12 @@
<span id='widget_list'>
<%= f.select :widget_path, @module_app.widgets.collect{|widget| [widget.humanize, widget]}, :selected => @part.widget_path %>
<%#= f.select :widget_path, @module_app.widgets.collect{|k,v| k}, :selected => @part.widget_path %>
</span>
<span id='widget_style_list'>
<%= @module_app.widget_indexs.collect { |k,v| v } %>
<%= f.select :widget_style, @module_app.widget_styles.each, :selected => @part.widget_style, :include_blank => 'None' %>
</span>
:
@@ -25,4 +31,9 @@
<%= t :or_lower %>
<span id="widget_tag">
<%= render 'widget_tags' %>
</span>
</span>
<div id="widget_data_count">
<%= f.label :widget_data_count %>
<%= f.text_field :widget_data_count %>
</div>
@@ -1,3 +1,3 @@
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|widget| [widget.humanize, widget]}) %>")
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k}) %>")
$('#widget_category').html("<%= j render 'widget_categories' %>")
$('#widget_tag').html("<%= j render 'widget_tags' %>")