mirror of https://github.com/lxndrblz/anatole.git

Marc-Niclas Harm
30.16.2022 b84efff11943dc926d5e04892c215d5533dc4bc0
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{{ if gt .Paginator.TotalPages 1 }}
  <ul class="pagination">
    {{ $.Scratch.Set "hasPrevDots" false }}
    {{ $.Scratch.Set "hasNextDots" false }}
    {{ if .Paginator.HasPrev }}
      <li class="page-item">
        <a class="page-link" href="{{ .Paginator.Prev.URL }}">
          <i class="fa fa-angle-left" aria-label="Previous"></i>
        </a>
      </li>
 
    {{ end }}
    {{ range .Paginator.Pagers }}
      {{ if eq . $.Paginator }}
        <li class="page-item">
          <span class="page-link current">
            {{- .PageNumber -}}
          </span>
        </li>
 
      {{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or  (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }}
        <li class="page-item">
          <a class="page-link" href="{{ .URL }}">
            {{- .PageNumber -}}
          </a>
        </li>
 
      {{ else }}
        {{ if and (not ($.Scratch.Get "hasPrevDots")) (lt .PageNumber $.Paginator.PageNumber) }}
          {{ $.Scratch.Set "hasPrevDots" true }}
          <span class="page-link dots">&hellip;</span>
 
        {{ else if and (not ($.Scratch.Get "hasNextDots")) (gt .PageNumber $.Paginator.PageNumber) }}
          {{ $.Scratch.Set "hasNextDots" true }}
          <span class="page-link dots">&hellip;</span>
 
        {{ end }}
 
 
      {{ end }}
 
 
    {{ end }}
    {{ if .Paginator.HasNext }}
      <li class="page-item">
        <a class="page-link" href="{{ .Paginator.Next.URL }}">
          <i class="fa fa-angle-right" aria-label="Next"></i>
        </a>
      </li>
 
    {{ end }}
  </ul>
 
{{ end }}