%
osm = @trans.t.osm
misc = @trans.t.misc
%>
function page_init() {
create_flexigrid('grid-tags', {
url: '/api/4/tags/popular',
colModel: [
{ display: '<%= h(osm.tag) %>', name: 'tag', width: 300, sortable: true },
{ display: ' <%= h(osm.objects) %>', name: 'count_all', width: 220, sortable: true, align: 'center' },
{ display: ' <%= h(osm.nodes) %>', name: 'count_nodes', width: 220, sortable: true, align: 'center' },
{ display: ' <%= h(osm.ways) %>', name: 'count_ways', width: 220, sortable: true, align: 'center' },
{ display: ' <%= h(osm.relations) %>', name: 'count_relations', width: 220, sortable: true, align: 'center' },
{ display: '', name: 'in_wiki', width: 20, sortable: true, align: 'center' }
],
searchitems: [
{ display: '<%= h(osm.tag) %>', name: 'tag' }
],
sortname: 'count_all',
sortorder: 'desc',
preProcess: function(data) {
data.rows = jQuery.map(data.data, function(row, i) {
return { 'cell': [
hover_expand(link_to_tag(row.key, row.value, {}, { 'class': 'pref' })),
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_checkmark(row.in_wiki)
] };
});
return data;
}
});
}