Fix for link in ad banner

This commit is contained in:
chris 2013-01-11 11:28:13 +08:00
parent 92f3be3200
commit a7d1cdbb75
2 changed files with 3 additions and 3 deletions

View File

@ -2,8 +2,8 @@ module FrontHelper
def ad_image_link(ad_image) def ad_image_link(ad_image)
link = ad_image.out_link link = ad_image.out_link
link =front_show_inner_ad_image_path(:id=> ad_image.id) if link.blank? && !ad_image.context.blank? link = front_show_inner_ad_image_path(:id=> ad_image.id) if link.blank? && !ad_image.context.blank?
link
end end
end end

View File

@ -19,7 +19,7 @@
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'> <div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
<% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %> <% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %>
<% if ad_image.display? %> <% if ad_image.display? %>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' title='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= ad_image_link(ad_image)%>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/> <img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' title='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= ad_image_link(ad_image) %>' style=' <%= 'cursor:pointer;' if !ad_image_link(ad_image).blank? %>'/>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>