fixed Widget data count should be available for other widgets, not only for default widget. The availability of this option must be set in the init

This commit is contained in:
Fu Matthew 2013-02-23 15:19:04 +08:00 committed by chris
parent 0e6599e9b9
commit d7699e1a46
3 changed files with 18 additions and 13 deletions

View File

@ -2,11 +2,9 @@
<% when PagePart %>
<% object_name = 'page_part' %>
<% field_name = 'widget_field' %>
<% data_count = 'widget_data_count' %>
<% when Page %>
<% object_name = 'page' %>
<% field_name = 'frontend_field' %>
<% data_count = 'frontend_data_count' %>
<% end %>
<div class="style_switch control-group">
@ -41,16 +39,5 @@
</span>
</div><br/>
<% end %>
<br/>
<div class="rows clear">
<span class="span4">
<%= label_tag t("default_widget.widget_data_count") %>
</span>
</div>
<div class="rows clear">
<span class="span4">
<%= text_field_tag "#{object_name}[#{data_count}]",object.send(data_count) %>
</span>
</div>
</div>
</div>

View File

@ -45,3 +45,12 @@
<div id="widget_setting">
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f,:object=>@part} %>
</div>
<div class="control-group">
<label for="page_part[widget_data_count]" class="control-label">
<%= t("default_widget.widget_data_count") %>
</label>
<div class="controls">
<%= text_field_tag "page_part[widget_data_count]",@part.widget_data_count %>
</div>
</div>

View File

@ -66,6 +66,15 @@
<%= render :partial => 'frontend_setting', :locals=>{:object=>@item,:f=>f} %>
</div>
<div class="control-group">
<label for="page[widget_data_count]" class="control-label">
<%= t("default_widget.widget_data_count") %>
</label>
<div class="controls">
<%= text_field_tag "page[frontend_data_count]",@item.frontend_data_count %>
</div>
</div>
<div class="control-group">
<%= f.label :is_published, "#{t('front_page.is_published')} ?", :class => 'control-label' %>