From b204e28c86172dfc1e28051a43924499dde42757 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 2 Jun 2015 17:48:53 +0800 Subject: [PATCH] added alternate text --- app/controllers/announcements_controller.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 8bdbd72..2a46a55 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -10,6 +10,8 @@ class AnnouncementsController < ApplicationController "status-class" => "status-#{status['classname']}" } end + desc = a.image_description + desc = (desc.nil? || desc == "" ? "announcement image" : desc) { "title" => a.title, "subtitle" => a.subtitle, @@ -18,7 +20,7 @@ class AnnouncementsController < ApplicationController "postdate" => a.postdate, "link_to_show" => OrbitHelper.url_to_show(a.to_param), "img_src" => a.image.thumb.url || "http://placehold.it/100x100", - "img_description" => a.image_description, + "img_description" => desc, "more" => t(:more_plus) } end @@ -47,6 +49,8 @@ class AnnouncementsController < ApplicationController "status-class" => "status-#{status['classname']}" } end + desc = a.image_description + desc = (desc.nil? || desc == "" ? "announcement image" : desc) { "title" => a.title, "subtitle" => a.subtitle, @@ -55,7 +59,7 @@ class AnnouncementsController < ApplicationController "postdate" => a.postdate, "link_to_show" => OrbitHelper.widget_item_url(a.to_param), "img_src" => a.image.thumb.url || "http://placehold.it/100x100", - "img_description" => a.image_description + "img_description" => desc } end { @@ -92,6 +96,8 @@ class AnnouncementsController < ApplicationController links = announcement.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => (link.title.blank? ? link.url : link.title) } } rescue [] update_user = announcement.update_user.member_profile.name rescue "" + desc = announcement.image_description + desc = (desc.nil? || desc == "" ? "announcement image" : desc) { "tags" => tags, "bulletin_files" => files, @@ -101,7 +107,8 @@ class AnnouncementsController < ApplicationController "update_user" => update_user, "updated_at" => announcement.updated_at.strftime('%Y-%m-%d %H:%M'), "body" =>announcement.text, - "image" => announcement.image.url + "image" => announcement.image.url, + "alt_image" => desc }, "impressionist" => (announcement.is_preview ? nil : announcement), "url_to_edit"=>url_to_edit