summaryrefslogtreecommitdiff
path: root/web/taginfo.rb
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-11-04 20:51:44 +0100
committerJochen Topf <jochen@topf.org>2010-11-04 20:51:44 +0100
commitc8b0e3ccd752f103f790aa790da50a3359c10453 (patch)
treeee3b6a6fedaaf54c2aeba2a5c7eb451f0785e0ee /web/taginfo.rb
parent1292fe579b19061a0b5f69014b3635a1a2e9f9e1 (diff)
parente83097f2cfc6e3663adc009179c27bf9485c14f5 (diff)
downloadtaginfo-c8b0e3ccd752f103f790aa790da50a3359c10453.tar
taginfo-c8b0e3ccd752f103f790aa790da50a3359c10453.tar.gz
Merged potlatch branch
Diffstat (limited to 'web/taginfo.rb')
-rwxr-xr-xweb/taginfo.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb
index ef08bf0..42a162c 100755
--- a/web/taginfo.rb
+++ b/web/taginfo.rb
@@ -317,6 +317,47 @@ class Taginfo < Sinatra::Base
#--------------------------------------------------------------------------
+ get '/sources/potlatch/?' do
+ @title = 'Potlatch'
+ @breadcrumbs << ['Sources', '/sources']
+ @breadcrumbs << ['Potlatch']
+
+ erb :'sources/potlatch/index'
+ end
+
+ get '/sources/potlatch/categories' do
+ @title = 'Potlatch Features'
+ @breadcrumbs << ['Sources', '/sources']
+ @breadcrumbs << ['Potlatch', '/sources/potlatch']
+ @breadcrumbs << ['Features']
+
+ @categories = @db.execute('SELECT * FROM potlatch.categories ORDER BY name')
+
+ erb :'sources/potlatch/categories'
+ end
+
+ get '/sources/potlatch/categories/:category' do
+ @category = params[:category]
+ @features = @db.execute('SELECT * FROM potlatch.features WHERE category_id=? ORDER BY name', @category)
+
+ erb :'sources/potlatch/category', :layout => false
+ end
+
+ get '/sources/potlatch/features/:feature' do
+ @feature_name = params[:feature]
+ @feature = @db.execute('SELECT * FROM potlatch.features WHERE name=?', @feature_name)[0]
+ @tags = @db.execute('SELECT * FROM potlatch.tags WHERE feature_name=? ORDER BY key, value', @feature_name)
+
+ erb :'sources/potlatch/feature', :layout => false
+ end
+
+ get %r{/sources/potlatch/icon/(.*)} do
+ content_type :png
+ IO.read('../../var/sources/potlatch/resources/' + params[:captures].first)
+ end
+
+ #--------------------------------------------------------------------------
+
get '/sources/merkaartor/?' do
@title = 'Merkaartor'
@breadcrumbs << ['Sources', '/sources']