summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-08-19 01:01:35 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-08-19 01:01:35 +0000
commit73ba49a7154a7a3f971ea0b53b4fdf232c4210b3 (patch)
tree2f627cd7f298bcd10330332db182d1377a7294b1 /app
parentc090d115e2bda1b72c2711b8df8a79202cbd10db (diff)
downloadredmine-73ba49a7154a7a3f971ea0b53b4fdf232c4210b3.tar.gz
redmine-73ba49a7154a7a3f971ea0b53b4fdf232c4210b3.zip
Use the base layout for all 403, 404, and 500 pages. #6172
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3949 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e5909e69b..725bde788 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -258,7 +258,7 @@ class ApplicationController < ActionController::Base
def render_403
@project = nil
respond_to do |format|
- format.html { render :template => "common/403", :layout => (request.xhr? ? false : 'base'), :status => 403 }
+ format.html { render :template => "common/403", :layout => use_layout, :status => 403 }
format.atom { head 403 }
format.xml { head 403 }
format.js { head 403 }
@@ -269,7 +269,7 @@ class ApplicationController < ActionController::Base
def render_404
respond_to do |format|
- format.html { render :template => "common/404", :layout => !request.xhr?, :status => 404 }
+ format.html { render :template => "common/404", :layout => use_layout, :status => 404 }
format.atom { head 404 }
format.xml { head 404 }
format.js { head 404 }
@@ -282,7 +282,7 @@ class ApplicationController < ActionController::Base
respond_to do |format|
format.html {
flash.now[:error] = msg
- render :text => '', :layout => !request.xhr?, :status => 500
+ render :text => '', :layout => use_layout, :status => 500
}
format.atom { head 500 }
format.xml { head 500 }
@@ -290,6 +290,13 @@ class ApplicationController < ActionController::Base
format.json { head 500 }
end
end
+
+ # Picks which layout to use based on the request
+ #
+ # @return [boolean, string] name of the layout to use or false for no layout
+ def use_layout
+ request.xhr? ? false : 'base'
+ end
def invalid_authenticity_token
if api_request?