diff options
| author | William Hergès <william@herges.fr> | 2025-10-03 18:40:45 +0200 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2025-10-03 18:40:45 +0200 |
| commit | 0de89e6bc6a467b2cc4261ae65464f40119cc0ff (patch) | |
| tree | 47ca3e894444950152b3ba0cf587f713d5aa7eaa /backend/templates/components.html | |
| parent | 270f592fc65cd5553ccf7c0dc81431c3efdf67ab (diff) | |
feat(frontend): use htmx to dynamically navigate between pages
Diffstat (limited to 'backend/templates/components.html')
| -rw-r--r-- | backend/templates/components.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/backend/templates/components.html b/backend/templates/components.html new file mode 100644 index 0000000..adafacf --- /dev/null +++ b/backend/templates/components.html @@ -0,0 +1,25 @@ +{{define "logs_display"}} +<article> + {{ range .Logs }} + <article> + <h2><a href="/log/{{ .Slug }}">{{ .LogTitle }}</a></h2> + <figure> + <a href="/log/{{ .Slug }}"><img src="{{ .Img.Src }}" alt="{{ .Img.Alt }}"></a> + <figcaption>{{ .Img.Legend }}</figcaption> + </figure> + <p> + {{ .Description }} + </p> + </article> + {{ end }} + {{ if ne .PagesNumber 1 }} + <div class="pagination"> + <div> + {{ 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}} + </div> + </div> + {{ end }} +</article> +{{end}} |
