From 8413e31048944edadd16e419bfdc126e60f4a136 Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Tue, 15 Jan 2013 10:25:55 +0800 Subject: [PATCH 1/2] add i18n --- vendor/built_in_modules/gallery/config/locales/zh_tw.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vendor/built_in_modules/gallery/config/locales/zh_tw.yml b/vendor/built_in_modules/gallery/config/locales/zh_tw.yml index 6cb8af93..164c93cc 100644 --- a/vendor/built_in_modules/gallery/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/gallery/config/locales/zh_tw.yml @@ -35,4 +35,5 @@ zh_tw: no_description: 沒有描述 widget_option: horizontal: 水平圖片數量 - vertical: 垂直圖片數量 \ No newline at end of file + vertical: 垂直圖片數量 + album: 相簿 \ No newline at end of file From ba75c0262215ff766a3dcd4212cbdb244da2c426 Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Tue, 15 Jan 2013 12:02:13 +0800 Subject: [PATCH 2/2] fix wrong behavior of new interface when a new page is newed --- app/views/admin/page_parts/_edit.html.erb | 1 - .../admin/page_parts/_module_widget.html.erb | 2 -- .../old_partials/_widget_fields.html.erb | 13 ------------- .../old_partials/_widget_options.html.erb | 17 ----------------- .../page_parts/reload_widget_styles.js.erb | 3 +-- 5 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 app/views/admin/page_parts/old_partials/_widget_fields.html.erb delete mode 100644 app/views/admin/page_parts/old_partials/_widget_options.html.erb diff --git a/app/views/admin/page_parts/_edit.html.erb b/app/views/admin/page_parts/_edit.html.erb index 0d96516c..c4bc7476 100644 --- a/app/views/admin/page_parts/_edit.html.erb +++ b/app/views/admin/page_parts/_edit.html.erb @@ -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| %>
<%= render :partial => kind, :locals => {:f => f} %> diff --git a/app/views/admin/page_parts/_module_widget.html.erb b/app/views/admin/page_parts/_module_widget.html.erb index 658d2a62..5cfcbbf0 100644 --- a/app/views/admin/page_parts/_module_widget.html.erb +++ b/app/views/admin/page_parts/_module_widget.html.erb @@ -1,4 +1,3 @@ -
<%= f.fields_for :title_translations do |f| %> <% @site_valid_locales.each do |locale| %> @@ -38,4 +37,3 @@ --> -
\ No newline at end of file diff --git a/app/views/admin/page_parts/old_partials/_widget_fields.html.erb b/app/views/admin/page_parts/old_partials/_widget_fields.html.erb deleted file mode 100644 index 99f41328..00000000 --- a/app/views/admin/page_parts/old_partials/_widget_fields.html.erb +++ /dev/null @@ -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 %>
- <% end %> - - <%= label_tag :widget_data_count %> - <%= text_field_tag :widget_data_count,@part.widget_data_count %> - <% end %> \ No newline at end of file diff --git a/app/views/admin/page_parts/old_partials/_widget_options.html.erb b/app/views/admin/page_parts/old_partials/_widget_options.html.erb deleted file mode 100644 index f3438058..00000000 --- a/app/views/admin/page_parts/old_partials/_widget_options.html.erb +++ /dev/null @@ -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)) %> - - - <% end %> - - <% end %> - -<% end %> \ No newline at end of file diff --git a/app/views/admin/page_parts/reload_widget_styles.js.erb b/app/views/admin/page_parts/reload_widget_styles.js.erb index 333765c9..8451fbec 100644 --- a/app/views/admin/page_parts/reload_widget_styles.js.erb +++ b/app/views/admin/page_parts/reload_widget_styles.js.erb @@ -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 %>