aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-24 22:57:47 +0100
committerJochen Topf <jochen@topf.org>2013-01-24 22:57:47 +0100
commit47dc19653b22e64faa060bb9d295c059ea2f9bdd (patch)
treea7ebe30b7e68fbbaf1a19ac1db567c070fb3b156 /web
parentc276cc2985433281bcf98df2d7c062c4e17ab530 (diff)
downloadtaginfo-47dc19653b22e64faa060bb9d295c059ea2f9bdd.tar
taginfo-47dc19653b22e64faa060bb9d295c059ea2f9bdd.tar.gz
Add in_wiki column to key values view
Diffstat (limited to 'web')
-rw-r--r--web/lib/api/v4/key.rb6
-rw-r--r--web/viewsjs/key.js.erb2
2 files changed, 7 insertions, 1 deletions
diff --git a/web/lib/api/v4/key.rb b/web/lib/api/v4/key.rb
index 7150560..a67209b 100644
--- a/web/lib/api/v4/key.rb
+++ b/web/lib/api/v4/key.rb
@@ -202,11 +202,12 @@ class Taginfo < Sinatra::Base
:ways => { :doc => 'Only values on tags used on ways.' },
:relations => { :doc => 'Only values on tags used on relations.' }
},
- :sort => %w( value count_all count_nodes count_ways count_relations ),
+ :sort => %w( value count_all count_nodes count_ways count_relations in_wiki ),
:result => paging_results([
[:value, :STRING, 'Value'],
[:count, :INT, 'Number of times this key/value is in the OSM database.'],
[:fraction, :FLOAT, 'Number of times in relation to number of times this key is in the OSM database.'],
+ [:in_wiki, :BOOL, 'Is there at least one wiki page for this tag.'],
[:description, :STRING, 'Description of the tag from the wiki.']
]),
:example => { :key => 'highway', :page => 1, :rp => 10, :sortname => 'count_ways', :sortorder => 'desc' },
@@ -242,6 +243,8 @@ class Taginfo < Sinatra::Base
o.count_nodes
o.count_ways
o.count_relations
+ o.in_wiki :in_wiki
+ o.in_wiki! :value
}.
paging(@ap).
execute()
@@ -273,6 +276,7 @@ class Taginfo < Sinatra::Base
:value => row['value'],
:count => row['count_' + filter_type].to_i,
:fraction => (row['count_' + filter_type].to_f / this_key_count.to_f).round_to(4),
+ :in_wiki => row['in_wiki'] == 1,
:description => wikidesc[row['value']]
} }
}.to_json
diff --git a/web/viewsjs/key.js.erb b/web/viewsjs/key.js.erb
index 6c89295..b9c6763 100644
--- a/web/viewsjs/key.js.erb
+++ b/web/viewsjs/key.js.erb
@@ -35,6 +35,7 @@ var create_flexigrid_for = {
colModel: [
{ display: '<%= osm.value %>', name: 'value', width: 200, sortable: true },
{ display: '<%= misc.count %>', name: 'count', width: 260, sortable: true, align: 'center' },
+ { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" width="16" height="16" title="<%= misc.in_wiki_tooltip %>"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' },
{ display: '<span title="<%= page.tag_description_from_wiki %>"><%= misc.description %></span>', name: 'description', width: 600, sortable: false, align: 'left' }
],
searchitems: [
@@ -47,6 +48,7 @@ var create_flexigrid_for = {
return { 'cell': [
hover_expand(link_to_value(key, row.value)),
fmt_value_with_percent(row.count, row.fraction),
+ fmt_checkmark(row.in_wiki),
row.description
] };
});