{% macro pagination(sorted_watches, total_per_page, current_page) %} {{ sorted_watches|length }} {% for row in sorted_watches|batch(total_per_page, ' ') %} {{ loop.index}} {% endfor %} {% endmacro %}