Some fixes for tags: authorization, translation…

can_use now takes all the open_for into account
This commit is contained in:
chris committed 2013-10-19 19:14:31 +08:00
1 parent d2602a3a84
commit 68a379f8a4
9 files changed
+30 -43

No files matched your search

@@ -1,12 +1,6 @@
class Admin::CategoriesController < OrbitBackendController
# TODO = put back ========================
# before_filter :force_order_for_visitor, only: [:index]
# before_filter :force_order_for_user, except: [:index]
# before_filter :for_app_sub_manager, except: [:index]
# ========================================
before_filter :setup_vars
# ========================================
open_for_manager
def index
@categories = get_categories_for_index
+1 -6
View File
@@ -2,12 +2,7 @@ class Admin::ItemsController < OrbitBackendController
layout "structure"
# TODO = put back ========================
# before_filter :authenticate_user!
# before_filter :find_parent_item
# before_filter :is_admin?
# before_filter :set_current_item
#=========================================
open_for_admin
def index
if params[:item_id]
@@ -1,13 +1,7 @@
class Admin::ModuleTagsController < OrbitBackendController
include OrbitTag::Merging
# TODO = put back ========================
# before_filter :force_order_for_visitor, only: [:index]
# before_filter :force_order_for_user, except: [:index]
# before_filter :for_app_sub_manager, except: [:index]
# ========================================
before_filter :setup_vars
# ========================================
open_for_manager
helper 'admin/tags'
@@ -33,6 +27,7 @@ class Admin::ModuleTagsController < OrbitBackendController
redirect_to admin_module_tags_url(module_app_id: @module_app_id)
else
@tag = ModuleTag.new(params[:module_tag])
flash.now[:error] = t('create.error.tag')
render :action => "new"
end
end
@@ -42,6 +37,7 @@ class Admin::ModuleTagsController < OrbitBackendController
if @tag.update_attributes(params[:module_tag])
redirect_to admin_module_tags_url(module_app_id: @module_app_id)
else
flash.now[:error] = t('update.error.tag')
render :action => "edit"
end
end
+2
View File
@@ -1,5 +1,7 @@
class Admin::TagsController < OrbitBackendController
include OrbitTag::Merging
open_for_manager
def index
@tags = @module_app.module_tags