From 15b9839b769ecdd243037a5f481d887c1a17facc Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Mon, 4 Mar 2013 14:40:29 +0800 Subject: [PATCH] fix archive category fix page adding failed --- app/views/admin/pages/_data_count_field.html.erb | 2 +- app/views/admin/pages/reload_frontend_pages.js.erb | 2 +- vendor/built_in_modules/archive/init.rb | 2 +- vendor/built_in_modules/gallery/init.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/admin/pages/_data_count_field.html.erb b/app/views/admin/pages/_data_count_field.html.erb index 48f355f0..1934b067 100644 --- a/app/views/admin/pages/_data_count_field.html.erb +++ b/app/views/admin/pages/_data_count_field.html.erb @@ -2,5 +2,5 @@ <%= t("default_widget.widget_data_count") %>
- <%= select_tag(field_name,options_for_select(@module_app.get_registration.get_data_count,field_value )) %> + <%= select_tag(field_name,options_for_select((@module_app.get_registration.get_data_count rescue []),field_value )) %>
\ No newline at end of file diff --git a/app/views/admin/pages/reload_frontend_pages.js.erb b/app/views/admin/pages/reload_frontend_pages.js.erb index 215ec3fb..f262a753 100644 --- a/app/views/admin/pages/reload_frontend_pages.js.erb +++ b/app/views/admin/pages/reload_frontend_pages.js.erb @@ -1,7 +1,7 @@ <% if @module_app %> $('#app_page_category').html("<%= j render :partial => 'admin/page_parts/widget_data_source_category' ,:locals=>{:object=>@page}%>"); $('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>"); - $("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page[frontend_data_count]',:field_value=>@page.frontend_data_count} %>"); + $("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page[frontend_data_count]',:field_value=>(@page.frontend_data_count rescue nil)} %>"); <% if !@module_app.app_pages.blank? %> $('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, @app_frontend_urls.first)) %>"); diff --git a/vendor/built_in_modules/archive/init.rb b/vendor/built_in_modules/archive/init.rb index eaac9765..7e32c041 100644 --- a/vendor/built_in_modules/archive/init.rb +++ b/vendor/built_in_modules/archive/init.rb @@ -35,7 +35,7 @@ module Archive head_label_i18n 'archive.archive',:icon_class=>"icons-archive" available_for [:admin,:guest,:manager,:sub_manager] active_for_controllers ({:private=>['archive_file_categorys','archive_files'],:public=>['panel/archive/back_end/tags']}) - active_for_object_auth ['BulletinCategory'] + # active_for_object_auth ['BulletinCategory'] head_link_path "panel_archive_back_end_archive_files_path" diff --git a/vendor/built_in_modules/gallery/init.rb b/vendor/built_in_modules/gallery/init.rb index d71b8af5..4bf15d27 100644 --- a/vendor/built_in_modules/gallery/init.rb +++ b/vendor/built_in_modules/gallery/init.rb @@ -44,7 +44,7 @@ module Gallery head_label_i18n 'gallery.gallery',:icon_class=>"icons-pictures" available_for [:admin,:guest,:manager,:sub_manager] active_for_controllers ({:private=>['albums','album_images','gallery_categories','/panel/gallery/back_end/tags']}) - active_for_object_auth ['BulletinCategory'] + active_for_object_auth ['GalleryCategory'] head_link_path "panel_gallery_back_end_albums_path"