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

  %nav
    %ul.pagination.pagination-sm
Jamesie Pic's avatar
Jamesie Pic committed
5
      - if page_obj.has_previous
6
        %li
Jamesie Pic's avatar
Jamesie Pic committed
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>

Jamesie Pic's avatar
Jamesie Pic committed
16
      - for p in page_range
Jamesie Pic's avatar
Quality    
Jamesie Pic committed
17
        - if p
Jamesie Pic's avatar
Jamesie Pic committed
18
          - if p == page_obj.number
Jamesie Pic's avatar
Quality    
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

Jamesie Pic's avatar
Jamesie Pic committed
27
      - if page_obj.has_next
28
        %li
Jamesie Pic's avatar
Jamesie Pic committed
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>

Jamesie Pic's avatar
Jamesie Pic committed
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
Jamesie Pic's avatar
Jamesie Pic committed
45
      %a{'href': '?paginate_by={{ limit }}'}
46
47
48
49
        {{ limit }}
      - if not forloop.last
        \/
    )
Jamesie Pic's avatar
Jamesie Pic committed
50
51
    - if grid_list
      - include 'core/blocks/grid-list.html'