diff options
author | Jochen Topf <jochen@topf.org> | 2015-02-26 16:16:07 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2015-02-26 16:16:07 +0100 |
commit | 2a61dab2ed4361b880a318e2b1d68317f3a2ae43 (patch) | |
tree | 5606a7134ec1aa693f9ab61c4214e502e52e0598 /web/viewsjs/reports/similar_keys.js.erb | |
parent | 128e7ac9bf397539834148ca9c7b58fd44cbfbf6 (diff) | |
download | taginfo-2a61dab2ed4361b880a318e2b1d68317f3a2ae43.tar taginfo-2a61dab2ed4361b880a318e2b1d68317f3a2ae43.tar.gz |
Add (hidden) similar keys tab on key page and similar keys report.
This commit adds the new tab and new report but doesn't activate them, because
they will not work until the database backend is updated.
Diffstat (limited to 'web/viewsjs/reports/similar_keys.js.erb')
-rw-r--r-- | web/viewsjs/reports/similar_keys.js.erb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/web/viewsjs/reports/similar_keys.js.erb b/web/viewsjs/reports/similar_keys.js.erb new file mode 100644 index 0000000..1ea191e --- /dev/null +++ b/web/viewsjs/reports/similar_keys.js.erb @@ -0,0 +1,36 @@ +<% + osm = @trans.t.osm + misc = @trans.t.misc + sim = @trans.t.reports.similar_keys + %> +function page_init() { + up = function() { window.location = '/reports'; }; + create_flexigrid('grid-keys', { + url: '/api/4/keys/similar', + colModel: [ + { display: '<%= h(sim.key_common) %>', name: 'key_common', width: 350, sortable: true }, + { display: '<%= h(sim.count_common) %>', name: 'count_all_common', width: 100, sortable: true, align: 'right' }, + { display: '<%= h(sim.key_rare) %>', name: 'key_rare', width: 350, sortable: true }, + { display: '<%= h(sim.count_rare) %>', name: 'count_all_rare', width: 100, sortable: true, align: 'right' }, + { display: '<%= h(sim.similarity) %>', name: 'similarity', width: 100, sortable: true, align: 'right' } + ], + searchitems: [ + { display: '<%= h(osm.key) %>', name: 'common_key' } + ], + sortname: 'count_all_common', + sortorder: 'desc', + preProcess: function(data) { + data.rows = jQuery.map(data.data, function(row, i) { + return { 'cell': [ + link_to_key(row.key_common), + row.count_all_common, + link_to_key(row.key_rare), + row.count_all_rare, + row.similarity + ] }; + }); + return data; + } + }); +} + |