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

  %nav
    %ul.pagination.pagination-sm
Jamesie Pic's avatar
Jamesie Pic committed
5
      - if page.has_previous
6
        %li
Jamesie Pic's avatar
Jamesie Pic committed
7
          %a{'href': '?={queries.urlencode}&page=={page.previous_page_number}',
8 9 10
             'aria-label': 'Previous'}
            <i aria-hidden="true" class="fa fa-chevron-left"></i>

Jamesie Pic's avatar
Jamesie Pic committed
11 12 13 14 15 16 17 18 19 20 21
      - for p in page.pages
        - if p
          - if p == page.number
            %li.active
              %a{'href': ''}
                {{ p }}
          - else
            %li
              %a{'href': '?={queries.urlencode}&page=={p}'}
                {{ p }}
        - else
22 23 24 25
          %li.disabled
            %a{'href': ''}


Jamesie Pic's avatar
Jamesie Pic committed
26
      - if page.has_next
27
        %li
Jamesie Pic's avatar
Jamesie Pic committed
28
          %a{'href': '?={queries.urlencode}&page=={page.next_page_number}',
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
             'aria-label': 'Next'}
            <i aria-hidden="true" class="fa fa-chevron-right"></i>

  %div.count
    Number of results : {{ paginator.count }}
    %br
    Number of displayed results :
    {{ paginator.per_page }}
    (
    - for limit in pagination_limits
      %a{'href': '?limit={{ limit }}'}
        {{ limit }}
      - if not forloop.last
        \/
    )
44
    - include 'core/blocks/grid-list.html'