fix wrong behavior of new interface when a new page is newed

This commit is contained in:
Fu Matthew 2013-01-15 12:02:13 +08:00
parent 8413e31048
commit ba75c02622
5 changed files with 1 additions and 35 deletions

View File

@ -6,7 +6,6 @@
<%= f.radio_button :kind, kind, :class => 'part_kind' %>
<%= t(kind, :scope => 'page_part_kinds') %>
<% end %>
<% LIST[:page_part_kinds].each do |kind| %>
<div id='<%= "part_#{kind}" %>' class='part_kind_partial' style="display:<%= kind.eql?(@part.kind) ? 'block' : 'none' %>">
<%= render :partial => kind, :locals => {:f => f} %>

View File

@ -1,4 +1,3 @@
<div style="display:block" class="part_kind_partial" id="part_module_widget">
<div>
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
@ -38,4 +37,3 @@
</span> -->
</div>

View File

@ -1,13 +0,0 @@
<% if (@module_app && @module_app.widget_fields) %>
<%= label_tag('widget_field') %>
<% @module_app.widget_fields.each_with_index do |widget_field, i| %>
<%= i+1 %>
<%= select_tag "page_part[widget_field][]", widget_field_options(i), :include_blank => true %>
<%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
<% end %>
<%= label_tag :widget_data_count %>
<%= text_field_tag :widget_data_count,@part.widget_data_count %>
<% end %>

View File

@ -1,17 +0,0 @@
<% if (@module_app && @module_app.widget_options) %>
<%= label_tag('widget_options') %>
<% if @module_app.key.eql?('gallery') %>
<%= t('gallery.gallery') %>
<%= select_tag "page_part[widget_options][album_id]", options_from_collection_for_select(@albums, :id, :name, :selected => (@part.widget_options[key] rescue nil)) %>
<% end %>
<% if @module_app.widget_options.has_key? @part.widget_path%>
<% @module_app.widget_options[@part.widget_path].each do |key,options| %>
<%= label_tag(t(@module_app.widget_options_fields_i18n[@part.widget_path][key]))%>
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
<% end %>
<% end %>
<% end %>

View File

@ -1,8 +1,7 @@
<% if !@part.widget_path.blank? %>
<% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>");
<% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %>
<% end %>