aboutsummaryrefslogtreecommitdiff
path: root/backend/templates/components.html
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-12-22 18:18:56 +0000
committerAnhgelus Morhtuuzh <william@herges.fr>2025-12-22 18:18:56 +0000
commit66d6ab349196fd5d95937f533faa9db6ba65ebb3 (patch)
tree84ce7dd31c9e4dc10dbb41c5428cc2cb66bb44d9 /backend/templates/components.html
parent1c86bdda2a3067ade9aa765d8d87fe27151dd895 (diff)
parentc66a5cc0809875df0299ebb80be423436c195416 (diff)
Merge pull request '[Feat] Stats' (#4) from feat/stats into main
Reviewed-on: https://git.anhgelus.world/anhgelus/small-web/pulls/4
Diffstat (limited to 'backend/templates/components.html')
-rw-r--r--backend/templates/components.html24
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>