diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 6e173e7..1840757 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -36,6 +36,7 @@ class GalleriesController < ApplicationController def widget albums = Album.filter_by_widget_categories params = OrbitHelper.params + counts = OrbitHelper.widget_data_count images = [] total_images = 0 @@ -43,8 +44,8 @@ class GalleriesController < ApplicationController albums.each do |album| total_images = total_images + album.album_images.count end - total_images = total_images > 9 ? 9 : total_images - while images.count < total_images and images.count < AlbumImage.count + total_images = counts > 9 ? 9 : counts + while images.count < counts and images.count < AlbumImage.count albums.each do |album| img = album.album_images.sample if !images.include?(img) && img != nil diff --git a/lib/gallery/engine.rb b/lib/gallery/engine.rb index d0f6f28..53dc9f6 100644 --- a/lib/gallery/engine.rb +++ b/lib/gallery/engine.rb @@ -5,7 +5,8 @@ module Gallery module_label "gallery.gallery" base_url File.expand_path File.dirname(__FILE__) widget_methods ["widget"] - widget_settings [] + # widget_settings [] + widget_settings [{"data_count"=>10}] categorizable authorizable frontend_enabled