diff options
author | Jochen Topf <jochen@topf.org> | 2010-11-04 20:48:20 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2010-11-04 20:48:20 +0100 |
commit | 1292fe579b19061a0b5f69014b3635a1a2e9f9e1 (patch) | |
tree | 551fe909de25d2520b2aee65f48d3688fc21c77e /web/taginfo.rb | |
parent | 0bf8b3ea8c9524a4a8666e5dcb5276c9729d45f6 (diff) | |
parent | 10f53cfe47f11629b26d550c7deabba4cc427fb3 (diff) | |
download | taginfo-1292fe579b19061a0b5f69014b3635a1a2e9f9e1.tar taginfo-1292fe579b19061a0b5f69014b3635a1a2e9f9e1.tar.gz |
added merkaartor branch
Diffstat (limited to 'web/taginfo.rb')
-rwxr-xr-x | web/taginfo.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb index 0980c5f..ef08bf0 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -171,6 +171,16 @@ class Taginfo < Sinatra::Base end @wiki_count = @db.count('wiki.wikipages').condition('value IS NULL').condition('key=?', @key).get_first_value().to_i + + (@merkaartor_type, @merkaartor_link, @merkaartor_selector) = @db.select('SELECT tag_type, link, selector FROM merkaartor.keys').condition('key=?', @key).get_columns(:tag_type, :link, :selector) + @merkaartor_images = [:node, :way, :area, :relation].map{ |type| + name = type.to_s.capitalize + '<img src="/img/types/' + (@merkaartor_selector =~ /Type is #{name}/ ? type.to_s : 'none') + '.16.png" alt="' + name + '" title="' + name + '"/>' + }.join(' ') + + @merkaartor_values = @db.select('SELECT value FROM merkaartor.tags').condition('key=?', @key).order_by([:value], :value, 'ASC').execute().map{ |row| row['value'] } + + @merkaartor_desc = @db.select('SELECT lang, description FROM key_descriptions').condition('key=?', @key).order_by([:lang], :lang, 'ASC').execute() erb :key end @@ -307,6 +317,15 @@ class Taginfo < Sinatra::Base #-------------------------------------------------------------------------- + get '/sources/merkaartor/?' do + @title = 'Merkaartor' + @breadcrumbs << ['Sources', '/sources'] + @breadcrumbs << ['Merkaartor'] + erb :'sources/merkaartor/index' + end + + #-------------------------------------------------------------------------- + load 'lib/api/db.rb' load 'lib/api/wiki.rb' load 'lib/api/josm.rb' |