aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2011-03-04 18:06:02 +0100
committerJochen Topf <jochen@topf.org>2011-03-04 18:06:02 +0100
commita8b477919838726172f82b4605a63871a8847942 (patch)
tree389bf128581f343aee649a4dcb9645e66f757f34 /web
parentc8da2729b5d4b539fe0fbc07e3ae0228b7d7a876 (diff)
downloadtaginfo-a8b477919838726172f82b4605a63871a8847942.tar
taginfo-a8b477919838726172f82b4605a63871a8847942.tar.gz
added support for different instances of OSM, added some translations
Diffstat (limited to 'web')
-rw-r--r--web/i18n/de.yml9
-rw-r--r--web/i18n/en.yml11
-rw-r--r--web/i18n/it.yml2
-rw-r--r--web/lib/instance.rb8
-rw-r--r--web/public/css/taginfo.css6
-rw-r--r--web/public/img/instance-world.pngbin0 -> 1617 bytes
-rw-r--r--web/public/img/instance.pngbin0 -> 403 bytes
-rw-r--r--web/public/js/taginfo.js18
-rwxr-xr-xweb/taginfo.rb28
-rw-r--r--web/views/layout.erb5
10 files changed, 72 insertions, 15 deletions
diff --git a/web/i18n/de.yml b/web/i18n/de.yml
index 07b9496..bc19498 100644
--- a/web/i18n/de.yml
+++ b/web/i18n/de.yml
@@ -26,6 +26,11 @@ taginfo:
maps: Karten
key_combinations: Kombinationen
data_from: Daten vom
+ instance:
+ title: Über dieses Taginfo
+ other: Andere Taginfo-Webseiten sind im <a href="http://wiki.openstreetmap.org/wiki/Taginfo/Sites">OSM-Wiki</a> zu finden.
+ description:
+ main: Dieses sind die Haupt-Taginfo-Webseiten. Sie enthalten OSM-Daten für die ganze Erde und werden täglich aktualisiert.
pages:
index:
@@ -123,3 +128,7 @@ reports:
wiki_pages_about_non_existing_keys:
name: Wiki-Seiten über nicht-existierende Keys
+misc:
+ values_less_than_one_percent: alle Values haben weniger als 1%
+ empty_string: leere Zeichenkette
+
diff --git a/web/i18n/en.yml b/web/i18n/en.yml
index 42462cc..dff278b 100644
--- a/web/i18n/en.yml
+++ b/web/i18n/en.yml
@@ -19,7 +19,7 @@ taginfo:
source: Source
sources: Sources
download: Download
- about: About
+ about: About Taginfo
wiki: Wiki
reports: Reports
keys: Keys
@@ -28,6 +28,11 @@ taginfo:
maps: Maps
key_combinations: Combinations
data_from: Data from
+ instance:
+ title: About this Taginfo site
+ other: See the <a href="http://wiki.openstreetmap.org/wiki/Taginfo/Sites">OSM wiki</a> for other sites.
+ description:
+ main: This is the main Taginfo site. It contains OSM data for the whole planet and is updated daily.
pages:
index:
@@ -176,3 +181,7 @@ reports:
added the documentation in the wiki as preparation for using a key or the wiki
page documents a now obsolete key), but it can also be a typo or other error.</p>
+misc:
+ values_less_than_one_percent: all values have less than 1%
+ empty_string: empty string
+
diff --git a/web/i18n/it.yml b/web/i18n/it.yml
index 1891dca..e542f1d 100644
--- a/web/i18n/it.yml
+++ b/web/i18n/it.yml
@@ -19,7 +19,7 @@ taginfo:
source: Fonte
sources: Fonti
download: Download
- about: Riguardo a
+ about: Riguardo a Taginfo
wiki: Wiki
reports: Reports
keys: Chiavi
diff --git a/web/lib/instance.rb b/web/lib/instance.rb
new file mode 100644
index 0000000..54473a0
--- /dev/null
+++ b/web/lib/instance.rb
@@ -0,0 +1,8 @@
+#
+# different instances of the Taginfo system can change the contents of this file for local needs
+#
+
+def taginfo_instance_description
+ 'This is a Taginfo test instance. To change this text look in <tt>web/lib/instance.rb</tt>. To change the icon above, change the image in <tt>web/public/img/instance.png</tt>.'
+end
+
diff --git a/web/public/css/taginfo.css b/web/public/css/taginfo.css
index f6b464b..c914565 100644
--- a/web/public/css/taginfo.css
+++ b/web/public/css/taginfo.css
@@ -409,3 +409,9 @@ table.drilldown td#feature {
}
/* ========== */
+
+div#instance_description a {
+ text-decoration: underline;
+}
+
+/* ========== */
diff --git a/web/public/img/instance-world.png b/web/public/img/instance-world.png
new file mode 100644
index 0000000..967ab4b
--- /dev/null
+++ b/web/public/img/instance-world.png
Binary files differ
diff --git a/web/public/img/instance.png b/web/public/img/instance.png
new file mode 100644
index 0000000..18b2366
--- /dev/null
+++ b/web/public/img/instance.png
Binary files differ
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js
index 092224a..1c56f53 100644
--- a/web/public/js/taginfo.js
+++ b/web/public/js/taginfo.js
@@ -10,6 +10,16 @@ jQuery(document).ready(function() {
}
return b;
})(window.location.search.substr(1).split('&'))
+
+ jQuery('#instance_description').dialog({
+ autoOpen: false,
+ position: [20, 50],
+ title: texts.instance_description.title
+ });
+
+ jQuery('#instance').click(function() {
+ jQuery('#instance_description').dialog('open');
+ });
});
function print_wiki_link(title, options) {
@@ -49,7 +59,7 @@ function print_key_or_tag_list(list) {
function print_prevalent_value_list(key, list) {
if (list.length == 0) {
- return '<i>all values have less than 1%</i>';
+ return '<i>' + texts.misc.values_less_than_one_percent + '</i>';
}
return jQuery.map(list, function(item, i) {
return link_to_value_with_title(key, item.value, '(' + (item.fraction * 100).toFixed(2) + '%)');
@@ -109,7 +119,7 @@ var pp_chars = '!"#$%&()*+,-/;<=>?@[\\]^`{|}~' + "'";
function pp_key(key) {
if (key == '') {
- return '<span class="badchar empty">empty string</span>';
+ return '<span class="badchar empty">' + texts.misc.empty_string + '</span>';
}
var result = '',
@@ -133,7 +143,7 @@ function pp_key(key) {
function pp_value(value) {
if (value == '') {
- return '<span class="badchar empty">empty string</span>';
+ return '<span class="badchar empty">' + texts.misc.empty_string + '</span>';
}
return value.replace(/ /g, '&#x2423;').replace(/\s/g, '<span class="whitespace">&nbsp;</span>');
}
@@ -250,7 +260,7 @@ var flexigrid_defaults = {
function create_flexigrid(domid, options) {
if (grids[domid] == null) {
- grids[domid] = jQuery('#' + domid).flexigrid(jQuery.extend({}, flexigrid_defaults, flexigrid_defaults_lang, options));
+ grids[domid] = jQuery('#' + domid).flexigrid(jQuery.extend({}, flexigrid_defaults, texts.flexigrid, options));
}
}
diff --git a/web/taginfo.rb b/web/taginfo.rb
index f1693e8..951c4ed 100755
--- a/web/taginfo.rb
+++ b/web/taginfo.rb
@@ -97,8 +97,8 @@ class Taginfo < Sinatra::Base
javascript 'jquery-ui-1.8.10.custom.min'
javascript 'flexigrid-minified'
javascript 'protovis-r3.2'
- javascript 'taginfo'
javascript 'lang/' + r18n.locale.code
+ javascript 'taginfo'
@db = SQL::Database.new('../../data')
@@ -255,19 +255,29 @@ class Taginfo < Sinatra::Base
get '/js/lang/:lang.js' do
trans = R18n::I18n.new(params[:lang], 'i18n')
- return 'var flexigrid_defaults_lang = ' + {
- :pagetext => trans.t.flexigrid.pagetext,
- :pagestat => trans.t.flexigrid.pagestat,
- :outof => trans.t.flexigrid.outof,
- :findtext => trans.t.flexigrid.findtext,
- :procmsg => trans.t.flexigrid.procmsg,
- :nomsg => trans.t.flexigrid.nomsg,
- :errormsg => trans.t.flexigrid.errormsg,
+ return 'var texts = ' + {
+ :flexigrid => {
+ :pagetext => trans.t.flexigrid.pagetext,
+ :pagestat => trans.t.flexigrid.pagestat,
+ :outof => trans.t.flexigrid.outof,
+ :findtext => trans.t.flexigrid.findtext,
+ :procmsg => trans.t.flexigrid.procmsg,
+ :nomsg => trans.t.flexigrid.nomsg,
+ :errormsg => trans.t.flexigrid.errormsg,
+ },
+ :instance_description => {
+ :title => trans.t.taginfo.instance.title
+ },
+ :misc => {
+ :values_less_than_one_percent => trans.t.misc.values_less_than_one_percent,
+ :empty_string => trans.t.misc.empty_string
+ }
}.to_json + ";\n"
end
#--------------------------------------------------------------------------
+ load 'lib/instance.rb'
load 'lib/api/db.rb'
load 'lib/api/wiki.rb'
load 'lib/api/josm.rb'
diff --git a/web/views/layout.erb b/web/views/layout.erb
index 7b32149..b996908 100644
--- a/web/views/layout.erb
+++ b/web/views/layout.erb
@@ -28,6 +28,11 @@
</form>
</div>
<div id="left">
+ <a id="instance" href="#"><img src="/img/instance.png" alt="" height="24" style="padding: 2px 6px 0 0;"/></a>
+ <div id="instance_description" style="display: none;" class="ui-widget-content ui-corner-all">
+ <p><%= taginfo_instance_description %></p>
+ <p><%= t.taginfo.instance.other %></p>
+ </div>
<a href="/"><img src="/img/taginfo.48.png" alt="Taginfo" width="48" height="24" style="padding-top: 2px;"/></a>
<span class="breadcrumbs"><%= breadcrumbs %></span>
</div>