<% osm = @trans.t.osm misc = @trans.t.misc %> function page_init() { create_flexigrid('grid-keys', { url: '/api/4/keys/all?include=prevalent_values', colModel: [ { display: '<%= h(osm.key) %>', name: 'key', width: 160, sortable: true }, { display: ' <%= h(osm.objects) %>', name: 'count_all', width: 160, sortable: true, align: 'center' }, { display: ' <%= h(osm.nodes) %>', name: 'count_nodes', width: 250, sortable: true, align: 'center' }, { display: ' <%= h(osm.ways) %>', name: 'count_ways', width: 250, sortable: true, align: 'center' }, { display: ' <%= h(osm.relations) %>', name: 'count_relations', width: 250, sortable: true, align: 'center' }, { display: '<%= h(osm.users) %>', name: 'users_all', width: 44, sortable: true, align: 'right' }, { display: 'Wiki', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, { display: '<%= h(osm.values) %>', name: 'values_all', width: 70, sortable: true, align: 'right' }, { display: '<%= h(misc.prevalent_values) %>', name: 'prevalent_values', width: 500, sortable: true } ], searchitems: [ { display: '<%= h(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), fmt_value_with_percent(row.count_all, row.count_all_fraction), fmt_value_with_percent(row.count_nodes, row.count_nodes_fraction), fmt_value_with_percent(row.count_ways, row.count_ways_fraction), fmt_value_with_percent(row.count_relations, row.count_relations_fraction), fmt_with_ts(row.users_all), fmt_checkmark(row.in_wiki), fmt_with_ts(row.values_all), fmt_prevalent_value_list(row.key, row.prevalent_values) ] }; }); return data; } }); }