From 4ddaaeb4d6acb9d48be3ca48cc18daff7191fa8d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 2 Jan 2013 17:49:35 +0100 Subject: Added (incomplete) name_tags report. This report will give more information about the "name" tag and its variants. The report is not complete yet, so it is disabled. --- web/viewsjs/reports/name_tags.js.erb | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 web/viewsjs/reports/name_tags.js.erb (limited to 'web/viewsjs') diff --git a/web/viewsjs/reports/name_tags.js.erb b/web/viewsjs/reports/name_tags.js.erb new file mode 100644 index 0000000..79f1ab5 --- /dev/null +++ b/web/viewsjs/reports/name_tags.js.erb @@ -0,0 +1,72 @@ +<% + osm = @trans.t.osm + misc = @trans.t.misc + %> +var create_flexigrid_for = { + "overview": function() { + create_flexigrid('grid-name', { + url: '/api/2/langtag/name', + colModel: [ + { display: '<%= osm.key %>', name: 'key', width: 250, sortable: true }, + { display: '<%= osm.objects %>', name: 'count_all', width: 100, sortable: true, align: 'right' }, + { display: 'Notes', name: 'notes', width: 500, sortable: true } + ], + searchitems: [ + { display: '<%= osm.key %>', name: 'key' } + ], + sortname: 'count_all', + sortorder: 'desc', + preProcess: function(data) { + data.rows = jQuery.map(data.data, function(row, i) { + return { 'cell': [ + link_to_key(row.key), + row.count_all, + '' + ] }; + }); + return data; + } + }); + }, + "bcp47": function(filter_type) { + create_flexigrid('grid-bcp47-subtags', { + url: '/api/2/langtag/bcp47?filter=' + encodeURIComponent(filter_type), + colModel: [ + { display: 'Type', name: 'type', width: 80, sortable: false }, + { display: 'Subtag', name: 'subtag', width: 80, sortable: true }, + { display: 'Description', name: 'description', width: 500, sortable: true }, + { display: 'Added', name: 'added', width: 80, sortable: true }, + { display: 'Notes', name: 'notes', width: 400, sortable: false } + ], + searchitems: [ + { display: 'Subtag or description', name: 'text' } + ], + sortname: 'subtag', + sortorder: 'asc', + preProcess: function(data) { + data.rows = jQuery.map(data.data, function(row, i) { + return { 'cell': [ + row.type, + '' + row.subtag + '', + row.description, + row.added, + row.notes + ] }; + }); + return data; + } + }); + } +}; + +function page_init() { + jQuery('#subtag-filter').bind('change', function() { + var value = this.value; + + var qs = jQuery.getQueryString; + qs['filter'] = value; + + window.location.search = jQuery.param(qs); + }); + page_init2(); +} -- cgit v1.2.3