diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index 0f513e1a9..f9b24090c 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -16,7 +16,10 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController end @categories = get_categories_for_index @albums = GalleryAlbum.all - @tags = get_tags + @tags = get_tags + @c = [] + @ac = @c.inject(@categories,:<<) + @album_category = @albums.map { |a| @categories.include?(a.category_id) } end def show diff --git a/vendor/built_in_modules/gallery/app/models/gallery_album.rb b/vendor/built_in_modules/gallery/app/models/gallery_album.rb index 6bfb4f6db..f8587239c 100644 --- a/vendor/built_in_modules/gallery/app/models/gallery_album.rb +++ b/vendor/built_in_modules/gallery/app/models/gallery_album.rb @@ -1,17 +1,17 @@ class GalleryAlbum - include Mongoid::Document + include Mongoid::Document include Mongoid::Timestamps include OrbitTag::Taggable - field :name, localize: true - field :description, localize: true - field :cover, default: "default" - field :cover_path #can refact - field :tag_names + field :name, localize: true + field :description, localize: true + field :cover, default: "default" + field :cover_path #can refact + field :tag_names # has_and_belongs_to_many :tags, :class_name => "GalleryTag" - has_many :gallery_images, :autosave => true, :dependent => :destroy + has_many :gallery_images, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :gallery_images, :allow_destroy => true - + end \ No newline at end of file diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_album.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_album.html.erb index 28d354d0a..332ac53be 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_album.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_album.html.erb @@ -11,14 +11,11 @@ \ No newline at end of file diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb index 53557f67e..5627cdd3d 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/index.html.erb @@ -11,49 +11,6 @@ end %> <%= stylesheet_link_tag "gallery" %> <%#= stylesheet_link_tag "filter" %> - -
- - -
-
- -
-
- -
-
-
- <% @categories.each do |c| %> - <%= c.title %> - <% end %> -
-
- Clear -
-
-
- -
- Clear -
-
-
-
@@ -62,7 +19,7 @@ end %>
-