diff options
author | Jochen Topf <jochen@topf.org> | 2010-11-05 21:34:43 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2010-11-05 21:34:43 +0100 |
commit | 996b19f81935a21ab7f325e1d35d94186108df25 (patch) | |
tree | db1db0e2d317d0f6ff87009497a02d848337de37 /web/lib | |
parent | 837a9a1677c4acf463412fa830e5dd2e67fdc9e3 (diff) | |
download | taginfo-996b19f81935a21ab7f325e1d35d94186108df25.tar taginfo-996b19f81935a21ab7f325e1d35d94186108df25.tar.gz |
redirect from previews commit was the wrong way around
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/test.rb | 4 | ||||
-rw-r--r-- | web/lib/ui/reports.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/sources/db.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/sources/josm.rb | 4 | ||||
-rw-r--r-- | web/lib/ui/sources/merkaartor.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/sources/potlatch.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/sources/wiki.rb | 4 | ||||
-rw-r--r-- | web/lib/utils.rb | 8 |
8 files changed, 13 insertions, 15 deletions
diff --git a/web/lib/test.rb b/web/lib/test.rb index d7e0143..6ff450a 100644 --- a/web/lib/test.rb +++ b/web/lib/test.rb @@ -1,11 +1,11 @@ # test.rb class Taginfo < Sinatra::Base - get! '/test/' do + get! '/test' do erb :'test/index' end - get! '/test/tags/' do + get! '/test/tags' do @title = ['Tags', 'Test'] @breadcrumbs << [ 'Test', '/test' ] @breadcrumbs << 'Tags' diff --git a/web/lib/ui/reports.rb b/web/lib/ui/reports.rb index cabd95d..bebad52 100644 --- a/web/lib/ui/reports.rb +++ b/web/lib/ui/reports.rb @@ -1,7 +1,7 @@ # web/lib/ui/reports.rb class Taginfo < Sinatra::Base - get! '/reports/' do + get! '/reports' do @title = 'Reports' @breadcrumbs << @title erb :'reports/index' diff --git a/web/lib/ui/sources/db.rb b/web/lib/ui/sources/db.rb index 130377e..572bbf2 100644 --- a/web/lib/ui/sources/db.rb +++ b/web/lib/ui/sources/db.rb @@ -1,7 +1,7 @@ # web/lib/ui/sources/db.rb class Taginfo < Sinatra::Base - get! '/sources/db/' do + get! '/sources/db' do @title = 'Database' @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['Database'] diff --git a/web/lib/ui/sources/josm.rb b/web/lib/ui/sources/josm.rb index 34e5c00..a65a576 100644 --- a/web/lib/ui/sources/josm.rb +++ b/web/lib/ui/sources/josm.rb @@ -1,14 +1,14 @@ # web/lib/ui/sources/josm.rb class Taginfo < Sinatra::Base - get! '/sources/josm/' do + get! '/sources/josm' do @title = 'JOSM' @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['JOSM'] erb :'sources/josm/index' end - get! '/sources/josm/styles/' do + get! '/sources/josm/styles' do @title = ['Styles', 'JOSM'] @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['JOSM', '/sources/josm'] diff --git a/web/lib/ui/sources/merkaartor.rb b/web/lib/ui/sources/merkaartor.rb index 684a5a1..0f04828 100644 --- a/web/lib/ui/sources/merkaartor.rb +++ b/web/lib/ui/sources/merkaartor.rb @@ -1,7 +1,7 @@ # web/lib/ui/sources/merkaartor.rb class Taginfo < Sinatra::Base - get! '/sources/merkaartor/' do + get! '/sources/merkaartor' do @title = 'Merkaartor' @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['Merkaartor'] diff --git a/web/lib/ui/sources/potlatch.rb b/web/lib/ui/sources/potlatch.rb index e686fb5..91afe84 100644 --- a/web/lib/ui/sources/potlatch.rb +++ b/web/lib/ui/sources/potlatch.rb @@ -1,7 +1,7 @@ # web/lib/ui/sources/potlatch.rb class Taginfo < Sinatra::Base - get! '/sources/potlatch/' do + get! '/sources/potlatch' do @title = 'Potlatch' @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['Potlatch'] diff --git a/web/lib/ui/sources/wiki.rb b/web/lib/ui/sources/wiki.rb index 67cf0eb..c8f1a78 100644 --- a/web/lib/ui/sources/wiki.rb +++ b/web/lib/ui/sources/wiki.rb @@ -1,14 +1,14 @@ # web/lib/ui/sources/wiki.rb class Taginfo < Sinatra::Base - get! '/sources/wiki/' do + get! '/sources/wiki' do @title = 'Wiki' @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['Wiki'] erb :'sources/wiki/index' end - get! '/sources/wiki/keys/' do + get! '/sources/wiki/keys' do @title = ['Keys', 'Wiki'] @breadcrumbs << ['Sources', '/sources'] @breadcrumbs << ['Wiki', '/sources/wiki'] diff --git a/web/lib/utils.rb b/web/lib/utils.rb index a8664ff..cfc9177 100644 --- a/web/lib/utils.rb +++ b/web/lib/utils.rb @@ -175,13 +175,11 @@ def external_link(title, link) %Q{→ <a class="extlink" href="#{link}" target="_blank">#{title}</a>} end -# Like the 'get' method but will add a redirect for the same path with trailing / removed +# Like the 'get' method but will add a redirect for the same path with trailing / added def get!(path, &block) get path, &block - if path =~ %r{^(.*)/$} - get $1 do - redirect path - end + get path + '/' do + redirect path end end |