diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index f6008ef..91dd718 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -2,12 +2,19 @@ class Admin::GalleriesController < OrbitAdminController before_filter :setup_vars before_action :authenticate_user, :except => "imgs" before_action :log_user_action - layout "back_end" def index - @albums = Album.where(:order => -1).desc(:created_at) - albums = Album.where(:order.gt => -1).asc(:order) + @tags = @module_app.tags + categories = @module_app.categories.enabled + @filter_fields = filter_fields(categories, @tags) + @filter_fields.delete(:status) + @albums = Album.where(:order => -1).desc(:created_at).with_categories(filters("category")).with_tags(filters("tag")) + albums = Album.where(:order.gt => -1).asc(:order).with_categories(filters("category")).with_tags(filters("tag")) @albums = @albums.concat(albums) - @tags = @module_app.tags + + if request.xhr? + render :partial => "album", :collection => @albums + end + end def show diff --git a/app/views/admin/galleries/index.html.erb b/app/views/admin/galleries/index.html.erb index f844aed..7b533e8 100644 --- a/app/views/admin/galleries/index.html.erb +++ b/app/views/admin/galleries/index.html.erb @@ -1,10 +1,18 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "gallery" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/jquery-ui-1.10.0.custom.min" %> + <%= javascript_include_tag "jquery.masonry.min.js" %> + <%= javascript_include_tag "jquery.lite.image.resize.js" %> + <%= javascript_include_tag "gallery" %> +<% end %> +<%= render_filter @filter_fields, "orbit_gallery" %>