alt text mods

This commit is contained in:
Harry Bomrah 2015-05-11 18:20:30 +08:00
parent 802b75546f
commit eb5cfe989a
1 changed files with 6 additions and 5 deletions

View File

@ -18,12 +18,13 @@ class AdBannersController < ApplicationController
image_link = OrbitHelper.is_mobile_view ? b.file.mobile.url : b.file.url
klass = i == 0 ? "active" : ""
caption = i == 0 ? '<div class="cycle-overlay"></div><div class="cycle-pager"></div>' : ""
title = (b.title.nil? || b.title == "" ? "ad-banner image" : b.title)
alt_text = (b.title.nil? || b.title == "" ? "ad-banner image" : b.title)
images << {
"image_link" => image_link,
"title" => title,
"title" => b.title,
"class" => klass,
"alt_text" => alt_text,
"height" => adbanner.height,
"width" => adbanner.width,
"caption" => caption,
@ -49,13 +50,13 @@ class AdBannersController < ApplicationController
adbanner.ad_images.can_display.each_with_index do |ad_b,i|
if ad_b.language_enabled.include?(I18n.locale.to_s)
image_link = OrbitHelper.is_mobile_view ? ad_b.file.mobile.url : ad_b.file.url
title = (ad_b.title.nil? || ad_b.title == "" ? "ad-banner image" : ad_b.title)
alt_text = (ad_b.title.nil? || ad_b.title == "" ? "ad-banner image" : ad_b.title)
caption = i == 0 ? '<div class="cycle-overlay"></div><div class="cycle-pager"></div>' : ""
klass = i == 0 ? "active" : ""
if ad_b.exchange_item == "1"
image_html = "<div class='w-ad-banner__slide #{klass}' data-link='#{ad_b.out_link || "#"}''><img class='w-ad-banner__image' src='#{image_link}'><div class='w-ad-banner__caption_text'>#{title}</div></div>"
image_html = "<div class='w-ad-banner__slide #{klass}' data-link='#{ad_b.out_link || "#"}''><img class='w-ad-banner__image' src='#{image_link}'><div class='w-ad-banner__caption_text'>#{ad_b.title}</div></div>"
else ad_b.exchange_item == "2"
image_html = "<div class='w-ad-banner__slide youtube #{klass}' data-yt-binded='0' data-youtube-id='ytplayer#{i}'><a class='w-ad-banner__slide' href='#{format_url(ad_b.youtube,i)}'>#{title}</a><div class='w-ad-banner__caption_text'>#{title}</div></div>"
image_html = "<div class='w-ad-banner__slide youtube #{klass}' data-yt-binded='0' data-youtube-id='ytplayer#{i}'><a class='w-ad-banner__slide' href='#{format_url(ad_b.youtube,i)}'>#{ad_b.title}</a><div class='w-ad-banner__caption_text'>#{ad_b.title}</div></div>"
end
images << {
"html" => image_html