put add admin pages using orbit back end controller

This commit is contained in:
Fu Matthew 2013-03-06 15:16:20 +08:00 committed by chris
parent f3e40c1405
commit 8609c8dec0
12 changed files with 14 additions and 34 deletions

View File

@ -1,4 +1,4 @@
class Admin::AppAuthsController < ApplicationController class Admin::AppAuthsController < OrbitBackendController
layout "admin" layout "admin"
before_filter :authenticate_user! before_filter :authenticate_user!
# before_filter :is_admin? ,:only => :index # before_filter :is_admin? ,:only => :index

View File

@ -1,4 +1,4 @@
class Admin::InfosController < ApplicationController class Admin::InfosController < OrbitBackendController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -1,4 +1,4 @@
class Admin::ItemsController < ApplicationController class Admin::ItemsController < OrbitBackendController
layout "site_editor" layout "site_editor"

View File

@ -1,4 +1,4 @@
class Admin::MemberSelectsController < ApplicationController class Admin::MemberSelectsController < OrbitBackendController
layout "new_admin" layout "new_admin"

View File

@ -1,4 +1,4 @@
class Admin::ModuleAppsController < ApplicationController class Admin::ModuleAppsController < OrbitBackendController
before_filter :user_has_manager_privilege?, :only => [ :assign_manager, :remove_manager ] before_filter :user_has_manager_privilege?, :only => [ :assign_manager, :remove_manager ]
before_filter :user_has_sub_manager_privilege?, :only => [ :assign_sub_manager, :remove_sub_manager ] before_filter :user_has_sub_manager_privilege?, :only => [ :assign_sub_manager, :remove_sub_manager ]

View File

@ -1,4 +1,4 @@
class Admin::ObjectAuthsController < ApplicationController class Admin::ObjectAuthsController < OrbitBackendController
include OrbitCoreLib::PermissionUtility include OrbitCoreLib::PermissionUtility
layout "new_admin" layout "new_admin"
before_filter :force_order before_filter :force_order

View File

@ -1,4 +1,4 @@
class Admin::PagePartsController < ApplicationController class Admin::PagePartsController < OrbitBackendController
layout "site_editor" layout "site_editor"

View File

@ -1,4 +1,4 @@
class Admin::PurchasesController < ApplicationController class Admin::PurchasesController < OrbitBackendController
require "net/http" require "net/http"
require "uri" require "uri"
require 'zip/zip' require 'zip/zip'

View File

@ -1,4 +1,4 @@
class Admin::RolesController < ApplicationController class Admin::RolesController < OrbitBackendController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -1,4 +1,4 @@
class Admin::SitesController < ApplicationController class Admin::SitesController < OrbitBackendController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!

View File

@ -59,30 +59,6 @@ class ApplicationController < ActionController::Base
redirect_to root_path redirect_to root_path
end end
# Check if the current_user is admin,if not redirect
def is_admin?
current_or_guest_user.admin? ? true : auth_failed_in_backend
end
# def is_manager?
# @module_app.is_manager?(current_or_guest_user) || is_admin?
# end
# # Check if the current_user is admin
# def is_member?
# if (current_user rescue false)
# return true
# end
# return false
# end
# def is_guest?
# if session[:guest_user_id]
# return true
# end
# return false
# end
def for_admin_only def for_admin_only
if is_admin? if is_admin?
true true

View File

@ -1,3 +1,7 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<div class="main2"> <div class="main2">
<h1 class="list_title"><%= t('list.purchase') %></h1> <h1 class="list_title"><%= t('list.purchase') %></h1>
<table class="table main-list"> <table class="table main-list">