Display bulletin files and links

This commit is contained in:
manson 2014-05-05 15:48:49 +08:00
parent 658ffe34a1
commit 327c300941
1 changed files with 11 additions and 3 deletions

View File

@ -35,11 +35,19 @@ class AnnouncementsController < ApplicationController
def show
params = OrbitHelper.params
announcement = Bulletin.can_display.find_by(:uid=>params[:uid])
{
files = announcement.bulletin_files.map{|file| { "file_url" => file.file.url, "file_title" => file.title } }
links = announcement.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => link.title } }
{
"bulletin_files" => files,
"bulletin_links" => links,
"data" => {
"title" => announcement.title,
"image" => (announcement.image.blank? ? "" : announcement.image.url),
"body" => announcement.text
"body" =>announcement.text,
"image" => announcement.image.url
}
}
end
end