make announcement json format to two layer
This commit is contained in:
parent
bfef1a8e7c
commit
81f67fc08a
|
@ -1,6 +1,6 @@
|
|||
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
|
||||
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
|
||||
@bulletin_categorys = get_categories_for_index("BulletinCategory")
|
||||
|
@ -22,7 +22,7 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
|
|||
categorys.each do |c|
|
||||
data << {
|
||||
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
|
||||
|
||||
|
@ -32,7 +32,8 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendCo
|
|||
end
|
||||
|
||||
def get_bulletins_json
|
||||
bulletin = Bulletin.find(:bulletin_category_id)
|
||||
bulletin = BulletinCategory.find(params[:bulletin_category_id]).bulletins
|
||||
p bulletin
|
||||
data = Array.new
|
||||
|
||||
bulletin.each do |b|
|
||||
|
|
|
@ -7,8 +7,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
# before_filter :for_admin_only,:only => [:]
|
||||
# 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_user,: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,: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]
|
||||
|
||||
before_filter :only => [ :new,:create,:edit,:update,:create] do |controller|
|
||||
controller.get_categorys('BulletinCategory')
|
||||
|
|
Loading…
Reference in New Issue