summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-15 22:33:53 +0100
committerJochen Topf <jochen@topf.org>2013-01-15 22:33:53 +0100
commitf10f0d7e7e36ed7d621a45dfc1d24119e42fd4b9 (patch)
treef144f138711e79a9c87ef3d8220522d6e4d55977
parente84891fb573895d555c90e25f7c377a87b54de27 (diff)
downloadtaginfo-f10f0d7e7e36ed7d621a45dfc1d24119e42fd4b9.tar
taginfo-f10f0d7e7e36ed7d621a45dfc1d24119e42fd4b9.tar.gz
Add 404 page
-rw-r--r--web/i18n/en.yml3
-rwxr-xr-xweb/taginfo.rb6
-rw-r--r--web/views/not_found.erb4
3 files changed, 13 insertions, 0 deletions
diff --git a/web/i18n/en.yml b/web/i18n/en.yml
index f0b9ab2..36225fa 100644
--- a/web/i18n/en.yml
+++ b/web/i18n/en.yml
@@ -82,6 +82,9 @@ misc:
in_josm_tooltip: Key appears in JOSM config.
pages:
+ not_found:
+ title: Not found
+ intro: Sorry, we could not find the page you were looking for.
index:
popular_keys: Some popular keys
keys:
diff --git a/web/taginfo.rb b/web/taginfo.rb
index 54c4144..812eb2d 100755
--- a/web/taginfo.rb
+++ b/web/taginfo.rb
@@ -175,6 +175,12 @@ class Taginfo < Sinatra::Base
#--------------------------------------------------------------------------
+ not_found do
+ erb :not_found
+ end
+
+ #--------------------------------------------------------------------------
+
# old deprecated API (version 2 and 3)
load 'lib/api/db.rb'
load 'lib/api/josm.rb'
diff --git a/web/views/not_found.erb b/web/views/not_found.erb
new file mode 100644
index 0000000..8820387
--- /dev/null
+++ b/web/views/not_found.erb
@@ -0,0 +1,4 @@
+<div class="box resize" style="text-align: center">
+ <h1 class="section" style="font-size: 260%; margin: 40px 0;">404 <%= t.pages.not_found.title %></h1>
+ <%= t.pages.not_found.intro %>
+</div>