From 9938585a5a035274764de4c05801b9ae8a53dc0b Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 12 Apr 2016 17:38:16 +0800 Subject: [PATCH] small fix for show page for remote anns --- app/controllers/announcements_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 7c09a00..8aa278c 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -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