From d7699e1a46b224c1a761512b420fefd4ed8caf1f Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Sat, 23 Feb 2013 15:19:04 +0800 Subject: [PATCH] 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 --- .../page_parts/_default_widget_setting.html.erb | 13 ------------- app/views/admin/page_parts/_module_widget.html.erb | 9 +++++++++ app/views/admin/pages/_form.html.erb | 9 +++++++++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/views/admin/page_parts/_default_widget_setting.html.erb b/app/views/admin/page_parts/_default_widget_setting.html.erb index f4546178..741da7d5 100644 --- a/app/views/admin/page_parts/_default_widget_setting.html.erb +++ b/app/views/admin/page_parts/_default_widget_setting.html.erb @@ -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 %>
@@ -41,16 +39,5 @@

<% end %> -
-
- - <%= label_tag t("default_widget.widget_data_count") %> - -
-
- - <%= text_field_tag "#{object_name}[#{data_count}]",object.send(data_count) %> - -
\ No newline at end of file diff --git a/app/views/admin/page_parts/_module_widget.html.erb b/app/views/admin/page_parts/_module_widget.html.erb index e1f81263..2ed647e7 100644 --- a/app/views/admin/page_parts/_module_widget.html.erb +++ b/app/views/admin/page_parts/_module_widget.html.erb @@ -45,3 +45,12 @@
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f,:object=>@part} %>
+ +
+ +
+ <%= text_field_tag "page_part[widget_data_count]",@part.widget_data_count %> +
+
diff --git a/app/views/admin/pages/_form.html.erb b/app/views/admin/pages/_form.html.erb index e3a626bc..98ab5249 100644 --- a/app/views/admin/pages/_form.html.erb +++ b/app/views/admin/pages/_form.html.erb @@ -66,6 +66,15 @@ <%= render :partial => 'frontend_setting', :locals=>{:object=>@item,:f=>f} %> +
+ +
+ <%= text_field_tag "page[frontend_data_count]",@item.frontend_data_count %> +
+
+
<%= f.label :is_published, "#{t('front_page.is_published')} ?", :class => 'control-label' %>