added widget and engine settings
This commit is contained in:
parent
3868aed034
commit
f414473897
|
@ -29,6 +29,31 @@ class GalleriesController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def widget
|
||||||
|
albums = Album.filter_by_widget_categories
|
||||||
|
params = OrbitHelper.params
|
||||||
|
|
||||||
|
images = []
|
||||||
|
while images.count < 9
|
||||||
|
albums.each do |album|
|
||||||
|
img = album.album_images.sample
|
||||||
|
if !images.include?(img) && img != nil
|
||||||
|
images << img
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
images = images.collect do |a|
|
||||||
|
{
|
||||||
|
"link_to_show" => "/" + I18n.locale.to_s + params[:url] + "/-" + a.id.to_s + "?method=theater",
|
||||||
|
"thumb-src" => a.file.thumb.url
|
||||||
|
}
|
||||||
|
end
|
||||||
|
{
|
||||||
|
"images" => images,
|
||||||
|
"extras" => {"widget-title"=>"Gallery"}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def theater
|
def theater
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
image = AlbumImage.find(params[:uid])
|
image = AlbumImage.find(params[:uid])
|
||||||
|
|
|
@ -4,7 +4,8 @@ module Gallery
|
||||||
OrbitApp.registration "Gallery", :type => "ModuleApp" do
|
OrbitApp.registration "Gallery", :type => "ModuleApp" do
|
||||||
module_label "gallery.gallery"
|
module_label "gallery.gallery"
|
||||||
base_url File.expand_path File.dirname(__FILE__)
|
base_url File.expand_path File.dirname(__FILE__)
|
||||||
|
widget_methods ["widget"]
|
||||||
|
widget_settings [{"data_count"=>10}]
|
||||||
categorizable
|
categorizable
|
||||||
authorizable
|
authorizable
|
||||||
frontend_enabled
|
frontend_enabled
|
||||||
|
|
Loading…
Reference in New Issue