pagination.haml 1.47 KB
Newer Older
1 2 3 4
.pagination-block

  %nav
    %ul.pagination.pagination-sm
5
      - if page_obj.has_previous
6
        %li
7 8 9 10 11 12
          %a{'href': '?={queries.urlencode}&page=1',
             'aria-label': 'First'}
            <i aria-hidden="true" class="fa fa-chevron-circle-left"></i>

        %li
          %a{'href': '?={queries.urlencode}&page=={page_obj.previous_page_number}',
13 14 15
             'aria-label': 'Previous'}
            <i aria-hidden="true" class="fa fa-chevron-left"></i>

16
      - for p in page_range
Jamesie Pic's avatar
Jamesie Pic committed
17
        - if p
18
          - if p == page_obj.number
Jamesie Pic's avatar
Jamesie Pic committed
19 20 21 22 23 24 25
            %li.active
              %a{'href': ''}
                {{ p }}
          - else
            %li
              %a{'href': '?={queries.urlencode}&page=={p}'}
                {{ p }}
26

27
      - if page_obj.has_next
28
        %li
29
          %a{'href': '?={queries.urlencode}&page=={page_obj.next_page_number}',
30 31 32
             'aria-label': 'Next'}
            <i aria-hidden="true" class="fa fa-chevron-right"></i>

33 34 35 36 37
        %li
          %a{'href': '?={queries.urlencode}&page=={paginator.num_pages}',
             'aria-label': 'Last'}
            <i aria-hidden="true" class="fa fa-chevron-circle-right"></i>

38 39 40 41 42 43 44
  %div.count
    Number of results : {{ paginator.count }}
    %br
    Number of displayed results :
    {{ paginator.per_page }}
    (
    - for limit in pagination_limits
45
      %a{'href': '?paginate_by={{ limit }}'}
46 47 48 49
        {{ limit }}
      - if not forloop.last
        \/
    )
50 51
    - if grid_list
      - include 'core/blocks/grid-list.html'