make announcement json format to two layer

This commit is contained in:
Rueshyna 2012-11-15 11:49:00 +08:00 committed by chris
parent bfef1a8e7c
commit 81f67fc08a
3 changed files with 1054 additions and 5 deletions

1048
out Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
include OrbitControllerLib::DivisionForDisable include OrbitControllerLib::DivisionForDisable
before_filter :for_app_manager,:except => [:index] before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_bulletins_json]
def index def index
@bulletin_categorys = get_categories_for_index("BulletinCategory") @bulletin_categorys = get_categories_for_index("BulletinCategory")
@ -22,7 +22,7 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
categorys.each do |c| categorys.each do |c|
data << { data << {
category: c.title, category: c.title,
# link: get_bulletin_json(c) link: "http://#{request.host_with_port}#{panel_announcement_back_end_bulletin_category_get_bulletins_json_path(c)}"
} }
end end
@ -32,7 +32,8 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
end end
def get_bulletins_json def get_bulletins_json
bulletin = Bulletin.find(:bulletin_category_id) bulletin = BulletinCategory.find(params[:bulletin_category_id]).bulletins
p bulletin
data = Array.new data = Array.new
bulletin.each do |b| bulletin.each do |b|

View File

@ -7,8 +7,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# before_filter :for_admin_only,:only => [:] # before_filter :for_admin_only,:only => [:]
# before_filter :for_app_manager,:only => [:index,:show,] # before_filter :for_app_manager,:only => [:index,:show,]
before_filter :force_order_for_visitor,:only=>[:index,:show,:get_sorted_and_filtered_bulletins] before_filter :force_order_for_visitor,:only=>[:index,:show,:get_sorted_and_filtered_bulletins]
before_filter :force_order_for_user,:except => [:index,:show,:get_sorted_and_filtered_bulletins,:get_bulletins_json,:get_bulletin_json] before_filter :force_order_for_user,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins,:get_bulletins_json,:get_bulletin_json] before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
before_filter :only => [ :new,:create,:edit,:update,:create] do |controller| before_filter :only => [ :new,:create,:edit,:update,:create] do |controller|
controller.get_categorys('BulletinCategory') controller.get_categorys('BulletinCategory')