changes in frontend rendering
This commit is contained in:
parent
01219aa756
commit
3d09db0eee
|
@ -1,21 +1,29 @@
|
|||
class AdBannersController < ApplicationController
|
||||
def widget
|
||||
adbanner = Banner.first
|
||||
images = adbanner.ad_images.collect do |b|
|
||||
adbanner = Banner.find(OrbitHelper.widget_custom_value)
|
||||
images = adbanner.ad_images.collect.with_index do |b,i|
|
||||
klass = i == 0 ? "active" : ""
|
||||
caption = i == 0 ? '<div class="cycle-overlay"></div><div class="cycle-pager"></div>' : ""
|
||||
{
|
||||
"ad_fx" => adbanner.ad_fx,
|
||||
"image_link" => b.file.url,
|
||||
"title" => b.title,
|
||||
"class" => klass,
|
||||
"height" => adbanner.height,
|
||||
"width" => adbanner.width,
|
||||
"caption" => caption,
|
||||
"context" => b.context,
|
||||
"link" => b.out_link || "#"
|
||||
}
|
||||
end
|
||||
{
|
||||
"extras" => {
|
||||
"ad_fx" => adbanner.ad_fx,
|
||||
"speed" => adbanner.speed,
|
||||
"title" => adbanner.title,
|
||||
"timeout" => adbanner.timeout,
|
||||
"image_link" => b.file.url,
|
||||
"more" => "More"
|
||||
}
|
||||
end
|
||||
{
|
||||
"extras" => {},
|
||||
"data" => images
|
||||
},
|
||||
"images" => images
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ module AdBanner
|
|||
module_label "ad_banner.ad_banner"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget"]
|
||||
|
||||
widget_settings [{"override_category_with"=>"banner","multiselect"=>false,"display_field"=>"title"}]
|
||||
taggable "Banner"
|
||||
categorizable
|
||||
authorizable
|
||||
|
|
Loading…
Reference in New Issue