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/key.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/key.js.erb')
-rw-r--r-- | web/viewsjs/key.js.erb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/web/viewsjs/key.js.erb b/web/viewsjs/key.js.erb index 165f91f..8f19ab2 100644 --- a/web/viewsjs/key.js.erb +++ b/web/viewsjs/key.js.erb @@ -83,6 +83,31 @@ var create_flexigrid_for = { } }); }, + similar: function(key) { + create_flexigrid('grid-similar', { + url: '/api/4/key/similar?key=' + encodeURIComponent(key), + colModel: [ + { display: '<%= h(page.similar.other) %>', name: 'other_key', width: 500, sortable: true }, + { display: '<span title="<%= h(page.similar.count_all_tooltip) %>"><%= h(misc.count) %></span>', name: 'count_all', width: 160, sortable: true, align: 'right' }, + { display: '<span title="<%= h(page.similar.similarity_tooltip) %>"><%= h(page.similar.similarity) %></span>', name: 'similarity', width: 100, sortable: true, align: 'right' } + ], + searchitems: [ + { display: '<%= h(page.similar.other) %>', name: 'other_key' } + ], + sortname: 'other_key', + sortorder: 'asc', + preProcess: function(data) { + data.rows = jQuery.map(data.data, function(row, i) { + return { 'cell': [ + link_to_key_with_highlight(row.other_key, key), + row.count_all, + row.similarity + ] }; + }); + return data; + } + }); + }, wiki: function(key, filter_type) { create_flexigrid('grid-wiki', { url: '/api/4/key/wiki_pages?key=' + encodeURIComponent(key), |