first version of app config and modified inits.

This commit is contained in:
Fu Matthew committed 2013-01-29 20:33:40 +08:00
1 parent bfaa22052f
commit 71d5abae2e
36 files changed
+377 -264

No files matched your search

@@ -1 +1 @@
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
<%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
@@ -6,11 +6,11 @@
<% if @module_app.nil? || @module_app.widgets.nil? || (@module_app.widgets[@widget_path].blank? rescue true) %>
<%= t("default_widget.no_support_setting")%>
<%else%>
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]) %>
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]["style"]) %>
<% end %>
</div>
</div>
<% if(@module_app && @module_app.widget_options && @module_app.widget_options.has_key?(@widget_path)) %>
<% if(@module_app && @module_app.widget_options(@widget_path)) %>
<div class="style_switch control-group">
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
<div class="controls well" >
@@ -17,7 +17,7 @@
<%= t "default_widget.select_module_app" %>
</label>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => admin_page_parts_path,:id=>"page_module_app_id"} %>
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => admin_page_parts_path,:id=>"page_module_app_id"} %>
</div>
</div>
@@ -26,7 +26,7 @@
<%= t "default_widget.select_widget_path" %>
</label>
<div class="controls">
<%= f.select :widget_path, @module_app ? @module_app.widgets.collect{|k,v| [k.humanize, k]} : [], {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %>
<%= f.select :widget_path, @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : [], {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %>
</div>
</div>
@@ -14,7 +14,7 @@
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
<%= radio_button_tag("#{field_name}[tag]", tag.id, tag_checked_value(object,tag.id) ) %>
<%= tag[I18n.locale]%>
<% end %>
<% end if @tags%>
</fieldset>
<% else %>
<%= t("default_widget.no_support_setting")%>
@@ -1,5 +1,6 @@
<% @module_app.widget_options[@widget_path].each do |key,options| %>
<%= label_tag(t(@module_app.widget_options_fields_i18n[@widget_path][key]))%>
<% @module_app.widget_options(@widget_path).get_options.each do |key,settings| %>
<% options = settings[:opts] %>
<%= label_tag(t(settings[:label_i18n]))%>
<% case options%>
<% when Hash%>
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
@@ -1,5 +1,5 @@
<% if @module_app%>
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k},@part.widget_path) %>");
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@part.widget_path) %>");
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category',:locals=>{:object=>@part} %>");
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag',:locals=>{:object=>@part} %>");
+1 -1
View File
@@ -1 +1 @@
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_pages_path } %>
<%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_pages_path } %>