fixed get_bulletins_json of gprs bug

This commit is contained in:
Rueshyna 2012-11-09 10:41:49 +08:00
parent 7595e20d0c
commit 80abfc80bf
1 changed files with 11 additions and 2 deletions

View File

@ -35,11 +35,20 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
else else
deadline = I18n.t("no_deadline") deadline = I18n.t("no_deadline")
end end
@data[I18n.t("category")][b.bulletin_category.title] = { title: b.title, if @data[I18n.t("category")][b.bulletin_category.title].nil?
@data[I18n.t("category")][b.bulletin_category.title] = Array.new
@data[I18n.t("category")][b.bulletin_category.title] << { title: b.title,
postdate: display_date_time(b.postdate), postdate: display_date_time(b.postdate),
deadline: deadline, deadline: deadline,
tag: b.sorted_tags.to_a, tag: b.sorted_tags.to_a,
} }
else
@data[I18n.t("category")][b.bulletin_category.title] << { title: b.title,
postdate: display_date_time(b.postdate),
deadline: deadline,
tag: b.sorted_tags.to_a,
}
end
end end
render :json => @data.to_json render :json => @data.to_json
end end