aboutsummaryrefslogtreecommitdiff
path: root/web/viewsjs
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-02 17:49:35 +0100
committerJochen Topf <jochen@topf.org>2013-01-02 17:49:35 +0100
commit4ddaaeb4d6acb9d48be3ca48cc18daff7191fa8d (patch)
tree2e4e5997acbec8b537d1c75dc2e1a47854082919 /web/viewsjs
parentda4158398754e121bc85f0df54bd02b8ef68d878 (diff)
downloadtaginfo-4ddaaeb4d6acb9d48be3ca48cc18daff7191fa8d.tar
taginfo-4ddaaeb4d6acb9d48be3ca48cc18daff7191fa8d.tar.gz
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.
Diffstat (limited to 'web/viewsjs')
-rw-r--r--web/viewsjs/reports/name_tags.js.erb72
1 files changed, 72 insertions, 0 deletions
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,
+ '<tt>' + row.subtag + '</tt>',
+ 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();
+}