summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-05-16 20:28:35 +0200
committerJochen Topf <jochen@topf.org>2014-05-16 20:28:35 +0200
commit82c16006d6204909c72711b3ecfb91a92e1288d2 (patch)
tree10fdbdffb7c35b2771de7ea6285ae9ea02d1f209 /web/lib
parent92730cc8ca987fc83a03e8a143b9b9667d21f412 (diff)
downloadtaginfo-82c16006d6204909c72711b3ecfb91a92e1288d2.tar
taginfo-82c16006d6204909c72711b3ecfb91a92e1288d2.tar.gz
Take filter into account when linking to overpass turbo wizard.
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/utils.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/lib/utils.rb b/web/lib/utils.rb
index f802956..5d7f2d6 100644
--- a/web/lib/utils.rb
+++ b/web/lib/utils.rb
@@ -97,7 +97,10 @@ def turbo_link(count, filter, key, value=nil)
else
value = '"' + quote_double(value) + '"'
end
- url = TaginfoConfig.get('turbo.wizard_url_prefix', 'http://overpass-turbo.eu/master?') + 'w=' + Rack::Utils::escape('"' + key + '"=' + value + ' ' + TaginfoConfig.get('turbo.wizard_area', 'global')) + '&R'
+ if filter != 'all'
+ filter_condition = ' and type:' + filter.chop
+ end
+ url = TaginfoConfig.get('turbo.wizard_url_prefix', 'http://overpass-turbo.eu/master?') + 'w=' + Rack::Utils::escape('"' + key + '"=' + value + filter_condition.to_s + ' ' + TaginfoConfig.get('turbo.wizard_area', 'global')) + '&R'
else
template = 'key';
parameters = { :key => key }