diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb index 0151d4c0..1802db62 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb @@ -1,6 +1,7 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController include OrbitControllerLib::DivisionForDisable - before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_bulletins_json] + # if someone want to use json format replace with rss, please add :get_bulletins_json to below + before_filter :for_app_manager,:except => [:index,:get_categorys_json] def index @bulletin_categorys = get_categories_for_index("BulletinCategory") @@ -22,7 +23,15 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo categorys.each do |c| data << { category: c.title, - link: "http://#{request.host_with_port}#{panel_announcement_back_end_bulletin_category_get_bulletins_json_path(c)}" + # this is a json format + # link: "http://#{request.host_with_port}#{panel_announcement_back_end_bulletin_category_get_bulletins_json_path(c)}" + # remember to uncommand a rule in route.rb, too + link: "#{url_for( :action => "index", + :controller => "panel/announcement/front_end/bulletins", + :format => :rss, + :only_path => false, + :inner=>true, + :category_id => c )}" } end diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb index 8fa7af68..456d57d9 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb @@ -1,10 +1,10 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController - + def initialize super @app_title = 'announcement' end - + # GET /bulletins # GET /bulletins.xml def index_bulletins_by_unit @@ -14,14 +14,15 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController end def index - @item = Page.find(params[:page_id]) - - if @item.frontend_data_count - @page_num = @item.frontend_data_count - else - @page_num = 15 - end - @frontend_style = @item.frontend_style + @item = Page.find(params[:page_id]) rescue nil + if @item + if @item.frontend_data_count + @page_num = @item.frontend_data_count + else + @page_num = 15 + end + @frontend_style = @item.frontend_style + end @page = Page.find(params[:page_id]) rescue nil if !params[:search_query].blank? @@ -54,9 +55,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController end impressionist(@tag) if @tag end - + end - + def show @page = Page.find(params[:page_id]) rescue nil if params[:preview] == "true" @@ -71,22 +72,22 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController render :text => "