module Admin::AdBannerHelper
def preview_block(ad_banner)
res =''
#same code as in frontend backend parser
if ad_banner
res << ""
res << "
"
printable_ad_images = []
ad_banner.ad_images.each do |ad_image|
if ad_image.display?
ad_image.weight.times do
printable_ad_images << ad_image
end
end
end
printable_ad_images.shuffle!
printable_ad_images.each do |ad_image| #TODO Need Reflact
res << "
"
end
res << "
"
res.html_safe
end
end
end