<% osm = @trans.t.osm page = @trans.t.reports.wiki_pages_about_non_existing_keys %> function page_init() { up = function() { window.location = '/reports'; }; create_flexigrid('grid-keys', { url: '/api/4/keys/all?filter=in_wiki,not_in_db&include=wikipages', colModel: [ { display: '<%= h(osm.key) %>', name: 'key', width: 250, sortable: true, align: 'left' }, { display: '<%= h(page.wiki_pages) %>', name: 'wikipages', width: 600, sortable: false, align: 'left' } ], searchitems: [ { display: '<%= h(osm.key) %>', name: 'key' } ], sortname: 'count_all', sortorder: 'desc', preProcess: function(data) { data.rows = jQuery.map(data.data, function(row, i) { var wikilinks = []; jQuery(row.wikipages).each(function(i, wikipage) { var w = link_to_wiki(wikipage.title); if (wikipage.type == 'redirect') { w += ' (REDIRECT)'; } wikilinks.push(w); }); return { 'cell': [ link_to_key(row.key), wikilinks.join('  •  ') ] }; }); return data; } }); }