[% SET linkbody = "type=${list.object_type}&" %]

<p class="pagination">
[% IF list.start %]
    <a href="[% handler_url %]?[% foreground %][% list.previous_qs %]">&lt;&lt;</a>
[% END %]

[% IF list.start == '0' && list.step >= list.total_records %]
    all [% list.total_records %] shown.
[% ELSE %]
    [% list.start + 1 %] to [% list.ends_at %] of [% list.total_records %] [% list.object_plural %]
[% END %]

[% IF list.next_step > 0 %]
    <a href="[% handler_url %]?[% linkbody %][% list.next_qs %]">&gt;&gt;</a>
[% END %]

[% IF list.total_records > 1 %]
<br>sort by : 
    [% FOREACH field = ['date', 'title'] %]
        [% IF list.order_by == field %]
            <b>[% field %]</b>
        [% ELSE %]
            <a href="[% handler_url %]?[% foreground %][% list.qs('sortby', field.key, 'sortorder', field.value, 'startat', 0) %]">[% field %]</a>
        [% END %]
    [% END %]
[% END %]
[% IF list.start > 0 || list.total_records > list.step %]
    <br>
    show: 
    [% IF list.step == 10 %]<b>10</b>[% ELSE %]<a href="[% handler_url %]?[% foreground %][% list.qs('startat', 0, 'step', 10) %]">10</a>[% END %]
    [% IF list.step == 20 %]<b>20</b>[% ELSE %]<a href="[% handler_url %]?[% foreground %][% list.qs('startat', 0, 'step', 20) %]">20</a>[% END %]
    [% IF list.step == 50 %]<b>50</b>[% ELSE %]<a href="[% handler_url %]?[% foreground %][% list.qs('startat', 0, 'step', 50) %]">50</a>[% END %]
    [% IF list.step == list.total_records %]<b>all</b>[% ELSE %]<a href="[% handler_url %]?[% foreground %][% list.qs('startat', 0, 'step', list.total_records) %]">all</a>[% END %]
[% END %]
</p>
