From f901405829d16257d603d21451503a1ced808db4 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Mon, 19 Jan 2009 15:36:21 -0300 Subject: [PATCH] ActionItem898: nice looking page for "not found" error --- app/controllers/application.rb | 3 +-- app/views/layouts/not_found.rhtml | 11 ----------- app/views/shared/not_found.rhtml | 10 ++++++++-- public/images/icons-app/alert-icon.png | Bin 0 -> 1024 bytes public/stylesheets/common.css | 13 +++++++++++++ 5 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 app/views/layouts/not_found.rhtml create mode 100644 public/images/icons-app/alert-icon.png diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 33c4b9a..9a83159 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -93,8 +93,7 @@ class ApplicationController < ActionController::Base def render_not_found(path = nil) @path ||= request.path -# raise "#{@path} not found" - render(:file => File.join(RAILS_ROOT, 'app', 'views', 'shared', 'not_found.rhtml'), :layout => 'not_found', :status => 404) + render :template => 'shared/not_found.rhtml', :status => 404 end def user diff --git a/app/views/layouts/not_found.rhtml b/app/views/layouts/not_found.rhtml deleted file mode 100644 index 3a50aa0..0000000 --- a/app/views/layouts/not_found.rhtml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - <%= _('Page not found') %> - - - - <%= yield %> - - diff --git a/app/views/shared/not_found.rhtml b/app/views/shared/not_found.rhtml index 09acf46..445518b 100644 --- a/app/views/shared/not_found.rhtml +++ b/app/views/shared/not_found.rhtml @@ -1,2 +1,8 @@ -

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>

- +
+

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>

+

<%= _('You may have clicked an expired link or mistyped the address.') %>

+
diff --git a/public/images/icons-app/alert-icon.png b/public/images/icons-app/alert-icon.png new file mode 100644 index 0000000..68a0c5f Binary files /dev/null and b/public/images/icons-app/alert-icon.png differ diff --git a/public/stylesheets/common.css b/public/stylesheets/common.css index 6b97bc4..c08a56a 100644 --- a/public/stylesheets/common.css +++ b/public/stylesheets/common.css @@ -418,3 +418,16 @@ div.pending-tasks { #theme-test-panel .button-bar { margin: 1em; } + +#content #not-found { + padding: 20px; + margin: 20px; + border: 1px solid #DDD; + -moz-border-radius: 6px; +} + +#content #not-found h1 { + text-align: left; + background: url(../images/icons-app/alert-icon.png) no-repeat; + padding-left: 30px; +} -- libgit2 0.21.2