ad banner preview
This commit is contained in:
1 parent
0eab9ca8fa
commit
d2a3a4d26e
5 files changed
+52
-27
No files matched your search
@@ -1,12 +1,5 @@
|
||||
module Admin::AdBannerHelper
|
||||
def preview_block(ad_banner)
|
||||
res =''
|
||||
#same code as in frontend backend parser
|
||||
if ad_banner
|
||||
res << "<script type='text/javascript'>
|
||||
$(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({delay: -1000, fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}', timeoutFn: getTimeout }); });
|
||||
</script>"
|
||||
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
|
||||
def preview_block_ad_images_helper(ad_banner)
|
||||
printable_ad_images = []
|
||||
ad_banner.ad_images.each do |ad_image|
|
||||
if ad_image.display?
|
||||
@@ -17,18 +10,7 @@ module Admin::AdBannerHelper
|
||||
end
|
||||
|
||||
printable_ad_images.shuffle!
|
||||
printable_ad_images.each do |ad_image| #TODO Need Reflact
|
||||
res << "<img src='#{ad_image.file}' "
|
||||
res << "alt='#{ad_image.title || ' '}' "
|
||||
res << "time_to_next='#{ad_banner.transition_sec}' "
|
||||
res << "link_open='#{ad_image.link_open}' "
|
||||
# res << "link_url='#{(ad_image.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "
|
||||
res << "link_url='#{(ad_image.out_link || ad_banner.context || ' ')}' "
|
||||
res << "/>"
|
||||
end
|
||||
res << "</div>"
|
||||
res.html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user