From 1c558a1783e1100f67693176f917897c23e4f0e7 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 17 Jul 2013 19:49:04 +0800 Subject: [PATCH] added tags to index page, added html safe for show --- .../panel/gallery/back_end/albums_controller.rb | 4 +++- .../gallery/back_end/albums/index.html.erb | 17 +++++++++++------ .../panel/gallery/back_end/albums/show.html.erb | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) 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 b2cd02aa..0f513e1a 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 @@ -15,7 +15,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController @authenticated = false end @categories = get_categories_for_index - @albums = GalleryAlbum.all + @albums = GalleryAlbum.all + @tags = get_tags end def show @@ -30,6 +31,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController def new @categories = get_categories_for_index + @tags = get_tags @album = GalleryAlbum.new end 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 e3fb6a2f..53557f67 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 @@ -1,3 +1,13 @@ +<% set_default_index do + objects @albums + filterable + filter_field type: 'objects', + values: @tags, + translation: 'tags', + object_field: 'name' +end %> +<%= render 'admin/default_index/index' %> + <%= stylesheet_link_tag "gallery" %> <%#= stylesheet_link_tag "filter" %> @@ -37,12 +47,7 @@
-
- Tags1 - Tags2 - Tags3 - Tags4 -
+ diff --git a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb index aa67ba1c..9197c2cb 100644 --- a/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb +++ b/vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/show.html.erb @@ -84,7 +84,7 @@