title fix for alt

This commit is contained in:
Harry Bomrah 2015-05-11 16:22:29 +08:00
parent 18badbe9fb
commit 802b75546f
1 changed files with 6 additions and 3 deletions

View File

@ -18,9 +18,11 @@ 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)
images << {
"image_link" => image_link,
"title" => b.title,
"title" => title,
"class" => klass,
"height" => adbanner.height,
"width" => adbanner.width,
@ -47,12 +49,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)
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'>#{ad_b.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'>#{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)}'>#{ad_b.title}</a><div class='w-ad-banner__caption_text'>#{ad_b.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)}'>#{title}</a><div class='w-ad-banner__caption_text'>#{title}</div></div>"
end
images << {
"html" => image_html