diff options
Diffstat (limited to 'backend/templates/components.html')
| -rw-r--r-- | backend/templates/components.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/backend/templates/components.html b/backend/templates/components.html index b4ffbe6..b180123 100644 --- a/backend/templates/components.html +++ b/backend/templates/components.html @@ -1,4 +1,14 @@ -{{define "section_display"}} +{{ define "pagination" }} +<nav> + {{ if ne .CurrentPage 1 }}<a href="?page={{ before .CurrentPage }}">Précédent</a>{{else}} + <p></p> + {{end}} + <p>{{ .CurrentPage }}/{{ .PagesNumber }}</p> + {{ if ne .CurrentPage .PagesNumber }}<a href="?page={{ next .CurrentPage }}">Suivant</a>{{else}} + <p></p> + {{end}} +</nav> +{{ end }} {{define "section_display"}} <article> {{ $uri := .URI }} {{ range .Data }} <article> @@ -11,17 +21,7 @@ </article> {{ end }} <div class="pagination"> - {{ if .Paginate }} - <nav> - {{ if ne .CurrentPage 1 }}<a href="?page={{ before .CurrentPage }}">Précédent</a>{{else}} - <p></p> - {{end}} - <p>{{ .CurrentPage }}/{{ .PagesNumber }}</p> - {{ if ne .CurrentPage .PagesNumber }}<a href="?page={{ next .CurrentPage }}">Suivant</a>{{else}} - <p></p> - {{end}} - </nav> - {{ else }} {{ if eq (len .Data) .LenMax }} + {{ if .Paginate }} {{ template "pagination" . }} {{ else }} {{ if eq (len .Data) .LenMax }} <a href="/{{ $uri }}/">Voir plus</a> {{ end }} {{ end }} </div> |
