Display bulletin files and links
This commit is contained in:
parent
658ffe34a1
commit
327c300941
|
@ -35,10 +35,18 @@ class AnnouncementsController < ApplicationController
|
||||||
def show
|
def show
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
announcement = Bulletin.can_display.find_by(:uid=>params[:uid])
|
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,
|
"title" => announcement.title,
|
||||||
"image" => (announcement.image.blank? ? "" : announcement.image.url),
|
"body" =>announcement.text,
|
||||||
"body" => announcement.text
|
"image" => announcement.image.url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue