aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2012-01-23 10:45:41 +0100
committerJochen Topf <jochen@topf.org>2012-01-23 10:45:41 +0100
commitbefc3243e5ec2679119834cf847dfc27ef98b3a2 (patch)
treef163418fd3b192f0f07e5d3565220d2a8d6a3bf6 /web
parent1559c0a6ecc7292535145bb021871d6f2d3ec02a (diff)
downloadtaginfo-befc3243e5ec2679119834cf847dfc27ef98b3a2.tar
taginfo-befc3243e5ec2679119834cf847dfc27ef98b3a2.tar.gz
fix broken section header, fix broken opensearch http://trac.openstreetmap.org/ticket/4178
Diffstat (limited to 'web')
-rw-r--r--web/lib/ui/search.rb6
-rw-r--r--web/lib/utils.rb7
2 files changed, 4 insertions, 9 deletions
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
<Contact>#{ TaginfoConfig.get('opensearch.contact') }</Contact>
<Url type="application/x-suggestions+json" rel="suggestions" template="__URL__/search/suggest?term={searchTerms}"/>
<Url type="text/html" method="get" template="__URL__/search?q={searchTerms}"/>
- <Url type="application/opensearchdescription+xml" rel="self" template="__URL__/opensearch.xml"/>
+ <Url type="application/opensearchdescription+xml" rel="self" template="__URL__/search/opensearch.xml"/>
<Image height="16" width="16" type="image/x-icon">__URL__/favicon.ico</Image>
</OpenSearchDescription>
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
-