aboutsummaryrefslogtreecommitdiff
path: root/uploader/templates/macro-table-pagination.html
blob: 292c53175b33d8c69715e1e9eb75681c3cf0cb0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{%macro table_pagination(start_at, page_count, total_count, base_uri, name)%}
{%set ns = namespace(forward_uri=base_uri, back_uri=base_uri)%}
{%set ns.forward_uri="brr"%}
  <div class="row">
    <div class="col-md-2" style="text-align: start;">
      {%if start_at > 0%}
      <a href="{{base_uri +
               '?start_at='+((start_at-page_count)|string) +
               '&count='+(page_count|string)}}">
                 <span class="glyphicon glyphicon-backward"></span>
                 Previous
        </a>
      {%endif%}
    </div>
    <div class="col-md-8" style="text-align: center;">
      Displaying {{name}} {{start_at+1}} to {{start_at+page_count if start_at+page_count < total_count else total_count}} of {{total_count}}</div>
      <div class="col-md-2" style="text-align: end;">
        {%if start_at + page_count < total_count%}
        <a href="{{base_uri +
                 '?start_at='+((start_at+page_count)|string) +
                 '&count='+(page_count|string)}}">
            Next<span class="glyphicon glyphicon-forward"></span></a>
        {%endif%}
      </div>
  </div>
{%endmacro%}