From befc3243e5ec2679119834cf847dfc27ef98b3a2 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Mon, 23 Jan 2012 10:45:41 +0100 Subject: fix broken section header, fix broken opensearch http://trac.openstreetmap.org/ticket/4178 --- web/lib/ui/search.rb | 6 +++--- web/lib/utils.rb | 7 +------ 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'web') diff --git a/web/lib/ui/search.rb b/web/lib/ui/search.rb index a523d68..61292b8 100644 --- a/web/lib/ui/search.rb +++ b/web/lib/ui/search.rb @@ -25,11 +25,11 @@ class Taginfo < Sinatra::Base #{ TaginfoConfig.get('opensearch.contact') } - + __URL__/favicon.ico END_XML - return opensearch.gsub(/__URL__/, base_url) + return opensearch.gsub(/__URL__/, TaginfoConfig.get('instance.url')) end # Returns search suggestions as per OpenSearch standard @@ -73,7 +73,7 @@ END_XML query, # the query string res, # the list of suggestions res.map{ |item| '' }, # the standard says this is for descriptions, we don't have any so this is empty - res.map{ |item| base_url + '/tags/' + item } # the page this search should got to (ignored by FF, Chrome) + res.map{ |item| TaginfoConfig.get('instance.url') + '/tags/' + item } # the page this search should got to (ignored by FF, Chrome) ].to_json + "\n" end end diff --git a/web/lib/utils.rb b/web/lib/utils.rb index 42ae151..592b3ee 100644 --- a/web/lib/utils.rb +++ b/web/lib/utils.rb @@ -43,7 +43,7 @@ end def section(id) @section = id.to_s - @section_title = t.taginfo[@section] + @section_title = (@section =~ /^(keys|tags)$/) ? t.osm[@section] : t.taginfo[@section] end # Escape tag key or value for XAPI according to @@ -181,8 +181,3 @@ def api(version, path, doc=nil, &block) get("/api/#{version}/#{path}", &block) end -# return the base url for this site -def base_url - request.scheme + '://' + request.host + ':' + request.port.to_s -end - -- cgit v1.2.3