diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 61d1eada..d0bfc41c 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AdminController < ApplicationController + layout 'admin' + before_filter :require_admin helper :sort diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a794b3b2..144ccdd5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -177,7 +177,7 @@ class ApplicationController < ActionController::Base def render_403 @project = nil - render :template => "common/403", :layout => !request.xhr?, :status => 403 + render :template => "common/403", :layout => (request.xhr? ? false : 'base'), :status => 403 return false end diff --git a/app/controllers/auth_sources_controller.rb b/app/controllers/auth_sources_controller.rb index 981f29f0..0f5fba14 100644 --- a/app/controllers/auth_sources_controller.rb +++ b/app/controllers/auth_sources_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class AuthSourcesController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb index ec101fe5..ec16be56 100644 --- a/app/controllers/custom_fields_controller.rb +++ b/app/controllers/custom_fields_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class CustomFieldsController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb index 8070df03..d39f5edf 100644 --- a/app/controllers/enumerations_controller.rb +++ b/app/controllers/enumerations_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class EnumerationsController < ApplicationController + layout 'admin' + before_filter :require_admin helper :custom_fields diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 54b5d1b9..96e59c28 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -16,7 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class GroupsController < ApplicationController - layout 'base' + layout 'admin' + before_filter :require_admin helper :custom_fields diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb index 3be6abf3..88f97ecb 100644 --- a/app/controllers/issue_statuses_controller.rb +++ b/app/controllers/issue_statuses_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class IssueStatusesController < ApplicationController + layout 'admin' + before_filter :require_admin verify :method => :post, :only => [ :destroy, :create, :update, :move, :update_issue_done_ratio ], diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 8074b18b..c701cac7 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class RolesController < ApplicationController + layout 'admin' + before_filter :require_admin verify :method => :post, :only => [ :destroy, :move ], diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index c1d94850..77e1da56 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class SettingsController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index cf797d85..1b7eddcb 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class TrackersController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 05dc5bc5..991afbff 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class UsersController < ApplicationController + layout 'admin' + before_filter :require_admin, :except => :show helper :sort @@ -62,7 +64,8 @@ class UsersController < ApplicationController if @user != User.current && !User.current.admin? && @memberships.empty? && events.empty? render_404 and return end - + render :layout => 'base' + rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rb index f11aa473..6e7c58e2 100644 --- a/app/controllers/workflows_controller.rb +++ b/app/controllers/workflows_controller.rb @@ -16,6 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class WorkflowsController < ApplicationController + layout 'admin' + before_filter :require_admin def index diff --git a/app/views/admin/_menu.rhtml b/app/views/admin/_menu.rhtml index ef2abbc5..87fa5c78 100644 --- a/app/views/admin/_menu.rhtml +++ b/app/views/admin/_menu.rhtml @@ -1,25 +1,19 @@ - - - -