From 06ab24374b8fa73f977d41f1075ea26cfaff608c Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Thu, 11 Jul 2013 18:48:51 +0800 Subject: [PATCH] Gallery - categories, module_authorization and tags to new_ui --- .../gallery/app/models/gallery_album.rb | 1 + .../gallery/config/locales/en.yml | 4 ++- vendor/built_in_modules/gallery/init.rb | 34 ++++++++++++------- 3 files changed, 25 insertions(+), 14 deletions(-) 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 f8587239..4cc0fbc7 100644 --- a/vendor/built_in_modules/gallery/app/models/gallery_album.rb +++ b/vendor/built_in_modules/gallery/app/models/gallery_album.rb @@ -2,6 +2,7 @@ class GalleryAlbum include Mongoid::Document include Mongoid::Timestamps + include OrbitCategory::Categorizable include OrbitTag::Taggable field :name, localize: true diff --git a/vendor/built_in_modules/gallery/config/locales/en.yml b/vendor/built_in_modules/gallery/config/locales/en.yml index 81d0d107..a9e39987 100644 --- a/vendor/built_in_modules/gallery/config/locales/en.yml +++ b/vendor/built_in_modules/gallery/config/locales/en.yml @@ -3,6 +3,8 @@ en: gallery: add_album: Add Album add_images: Add Images + all: All + new: New album: Album album_desc: Album Description album_name: Album Name @@ -20,7 +22,7 @@ en: frontend: albums: Front-end albums gallery: Gallery - manage_categories: Manage Category + categories: Category new_category: New Category no_description: No Decription photo_tag: Photo Tag diff --git a/vendor/built_in_modules/gallery/init.rb b/vendor/built_in_modules/gallery/init.rb index 8cc3bc72..32398a68 100644 --- a/vendor/built_in_modules/gallery/init.rb +++ b/vendor/built_in_modules/gallery/init.rb @@ -16,8 +16,8 @@ module Gallery end end - category ["gallery_categories"] - + authorizable + categorizable taggable widgets do @@ -49,24 +49,32 @@ module Gallery active_for_object_auth ['GalleryCategory'] head_link_path "panel_gallery_back_end_albums_path" - - context_link 'categories', - :link_path=>"panel_gallery_back_end_gallery_categories_path" , + + context_link 'gallery.all', + :link_path=>"panel_gallery_back_end_albums_path" , :priority=>3, - :active_for_action=>{:gallery_categories=>:index}, + :active_for_category => 'Gallery', + :active_for_action=>{:albums=>:index}, + :available_for => [:manager] + + context_link 'gallery.new', + :link_path=>"new_panel_gallery_back_end_album_path" , + :priority=>3, + :active_for_category => 'Gallery', + :active_for_action=>{:albums=>:new}, + :available_for => [:manager] + + context_link 'gallery.categories', + :link_path=>"admin_module_app_categories_path(get_module_app)" , + :priority=>3, + :active_for_category => 'Gallery', :available_for => [:manager] context_link 'tags', - :link_path=>"admin_module_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Gallery'}))" , + :link_path=>"admin_module_tags_path(module_app_id: get_module_app)" , :priority=>4, :active_for_tag => 'Gallery', :available_for => [:manager] - - context_link 'module_authorization', - :link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Gallery'}))", - :priority=>6, - :active_for_app_auth => 'gallery', - :available_for => [:admin] end end end