added widget and engine settings
This commit is contained in:
1 parent
3868aed034
commit
f414473897
2 files changed
+33
-7
No files matched your search
@@ -19,15 +19,40 @@ class GalleriesController < ApplicationController
|
||||
album = Album.find_by_param(params[:uid])
|
||||
images = album.album_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
|
||||
"link_to_show" => "/" + I18n.locale.to_s + params[:url] + "/-" + a.id.to_s + "?method=theater",
|
||||
"thumb-src" => a.file.thumb.url
|
||||
}
|
||||
end
|
||||
end
|
||||
{
|
||||
"images" => images,
|
||||
"data" => {"album-title"=>album.name}
|
||||
}
|
||||
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,
|
||||
"data" => {"album-title"=>album.name}
|
||||
"extras" => {"widget-title"=>"Gallery"}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def theater
|
||||
params = OrbitHelper.params
|
||||
|
||||
Reference in new issue
Block a user