[%# components/pagination.tt Pagination block. Call as follows: INCLUDE components/pagination.tt current => 1, # current page we're viewing total_pages => 5, # total number of pages this is split into Authors: Afuna Copyright (c) 2015 by Dreamwidth Studios, LLC. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. For a copy of the license, please reference 'perldoc perlartistic' or 'perldoc perlgpl'. %] [%- IF total_pages > 1 -%] [% opts = {keep_args => 1}; IF cur_args; opts.cur_args = cur_args; END %] [%- END -%] [%- BLOCK print_pages -%] [%- FOREACH page_num = range -%] [% opts.args = { page => page_num } %] [% page_num %] [%- END -%] [%- END -%] [%- BLOCK print_ellipsis -%]
  • [%- END -%]