small fix for show page for remote anns

This commit is contained in:
Harry Bomrah 2016-04-12 17:38:16 +08:00
parent 10ed85e4fb
commit 9938585a5a
1 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ class AnnouncementsController < ApplicationController
"status-class" => "status-source"
}
files = fa["bulletin_files"].collect{|bf| { "file_url" => bf["url"], "file_title" => (fa["title_translations"][locale].blank? ? fa["url"] : fa["title_translations"][locale] rescue '') }} rescue []
files = fa["bulletin_files"].collect{|bf| { "file_url" => bf["url"], "file_title" => (fa["title_translations"][locale].blank? ? File.basename(fa["url"]) : fa["title_translations"][locale] rescue '') }} rescue []
links = fa["bulletin_links"].map{|link| { "link_url" => link["url"], "link_title" => (link["title_translations"][locale].blank? ? link["url"] : link["title_translations"][locale]) } } rescue []
x = {
@ -290,7 +290,7 @@ class AnnouncementsController < ApplicationController
links = announcement["bulletin_links"].map{|link| { "link_url" => link["url"], "link_title" => (link["title_translations"][locale] == "" ? link["url"] : link["title_translations"][locale]) } } rescue []
update_user = announcement["author"]
desc = announcement["image_description_translations"][locale]
desc = announcement["image_description_translations"][locale] rescue ""
desc = (desc.nil? || desc == "" ? "announcement image" : desc)
request = OrbitHelper.request