extends layout block content div.uk-grid br br div.uk-width-1-1 div.uk-panel.uk-panel-box div.uk-badge.uk-float-right form.uk-search input(class='uk-search-field', type='search', placeholder='Search...') button(class='uk-close', type='reset') table.uk-table.uk-table-hover.uk-table-striped caption #{ucfirst(currency)} Farmer Ladder Rankings ( farmers total) thead tr th Rank th Viewer th #{ucfirst(currency)} tbody ul.uk-pagination block postscript script. var perPage = 20, data = !{JSON.stringify(rows)}, lastPage = Math.ceil(data.length/perPage); function minifyPagination() { var current = parseInt($('li.uk-active').attr('page')), min = Math.max(current-3, 1), max = current+3; $('#page_first, #page_last').remove(); $('ul.uk-pagination > li').addClass('uk-hidden'); for(var x = min; x <= max; x++) { $('li#'+x).removeClass('uk-hidden'); } if (min > 1) $('li#'+min).before(""); if (max < lastPage) $('li#'+max).after(""); $('#page_first').click(function(){ $('li#'+1).click(); }); $('#page_last').click(function(){ $('li#'+lastPage).click(); }); }; $(document).ready(function(){ // Live search of the ladder listings $('.uk-search-field').keyup(function() { var query = $(this).val(); if(query.length > 2) { var temp = $('.uk-active').attr('page'); $('.uk-active').removeClass('uk-active').empty().append(''+temp+''); $('table > tbody').empty(); data.forEach(function(element, index, array) { if(element.user.search(new RegExp(query, 'i')) != -1) { $('table > tbody').append($('