diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 074a1cfd..23654497 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base end rescue_from ActiveRecord::RecordNotFound do |exception| - render "errors/not_found", :layout => "error" + render "errors/not_found", :layout => "error", :status => 404 end layout :layout_by_resource @@ -58,15 +58,15 @@ class ApplicationController < ActionController::Base end def access_denied! - render "errors/access_denied", :layout => "error" + render "errors/access_denied", :layout => "error", :status => 404 end def not_found! - render "errors/not_found", :layout => "error" + render "errors/not_found", :layout => "error", :status => 404 end def git_not_found! - render "errors/git_not_found", :layout => "error" + render "errors/git_not_found", :layout => "error", :status => 404 end def method_missing(method_sym, *arguments, &block) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 71821080..3b59a895 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -114,6 +114,7 @@ class ProjectsController < ApplicationController def project @project ||= Project.find_by_code(params[:id]) + @project || render_404 end def determine_layout diff --git a/public/404.html b/public/404.html index 16d8fcbc..33325890 100644 --- a/public/404.html +++ b/public/404.html @@ -2,22 +2,12 @@ The page you were looking for doesn't exist (404) - + - -
-

404

+

404

+

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.

diff --git a/public/422.html b/public/422.html index 24532664..8b19ea89 100644 --- a/public/422.html +++ b/public/422.html @@ -2,22 +2,13 @@ The change you wanted was rejected (422) - + -
-

422

+

422

+

The change you wanted was rejected.

Maybe you tried to change something you didn't have access to.

diff --git a/public/500.html b/public/500.html index b1d54464..36e14b80 100644 --- a/public/500.html +++ b/public/500.html @@ -2,22 +2,13 @@ We're sorry, but something went wrong (500) - + -
-

500

+

500

+

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

diff --git a/public/static.css b/public/static.css new file mode 100644 index 00000000..6090d7b2 --- /dev/null +++ b/public/static.css @@ -0,0 +1,57 @@ +body { color: #666; text-align: center; font-family: arial, sans-serif; margin:0; padding:0; } +h1 { font-size: 48px; color: #444; line-height: 1.5em; } +h2 { font-size: 24px; color: #666; line-height: 1.5em; } + +.alert-message { + position: relative; + padding: 7px 15px; + margin-bottom: 18px; + color: #404040; + background-color: #eedc94; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94)); + background-image: -moz-linear-gradient(top, #fceec1, #eedc94); + background-image: -ms-linear-gradient(top, #fceec1, #eedc94); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94)); + background-image: -webkit-linear-gradient(top, #fceec1, #eedc94); + background-image: -o-linear-gradient(top, #fceec1, #eedc94); + background-image: linear-gradient(top, #fceec1, #eedc94); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFCEEC1', endColorstr='#FFEEDC94', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #eedc94 #eedc94 #e4c652; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) fadein(rgba(0, 0, 0, 0.1), 15%); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + border-width: 1px; + border-style: solid; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); +} +.alert-message .close { + margin-top: 1px; + *margin-top: 0; +} +.alert-message a { + font-weight: bold; + color: #404040; +} +.alert-message.danger p a, .alert-message.error p a, .alert-message.success p a, .alert-message.info p a { + color: #404040; +} +.alert-message h5 { + line-height: 18px; +} +.alert-message p { + margin-bottom: 0; +} +.alert-message div { + margin-top: 5px; + margin-bottom: 2px; + line-height: 28px; +} + +.alert-message.block-message.error { + background: #FDDFDE; + border-color: #FBC7C6; +} +