diff options
Diffstat (limited to 'backend/templates')
| -rw-r--r-- | backend/templates/components.html | 14 | ||||
| -rw-r--r-- | backend/templates/home.html | 2 | ||||
| -rw-r--r-- | backend/templates/home_log.html | 10 | ||||
| -rw-r--r-- | backend/templates/log.html | 11 |
4 files changed, 14 insertions, 23 deletions
diff --git a/backend/templates/components.html b/backend/templates/components.html index 8f1bcc2..72bf40e 100644 --- a/backend/templates/components.html +++ b/backend/templates/components.html @@ -1,4 +1,4 @@ -{{define "logs_display"}} +{{define "section_display"}} <article> {{ $uri := .URI }} {{ range .Data }} <article> @@ -11,7 +11,19 @@ </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 }} <a href="/{{ $uri }}/">Voir plus</a> + {{ end }} </div> </article> {{end}} diff --git a/backend/templates/home.html b/backend/templates/home.html index 3ff9ce3..d5dbb28 100644 --- a/backend/templates/home.html +++ b/backend/templates/home.html @@ -8,7 +8,7 @@ <div> <h2>{{ .Name }}</h2> <p>{{ .Description }}</p> - {{ template "logs_display" . }} + {{ template "section_display" . }} </div> {{ end }} </main> diff --git a/backend/templates/home_log.html b/backend/templates/home_log.html deleted file mode 100644 index 28bf36a..0000000 --- a/backend/templates/home_log.html +++ /dev/null @@ -1,10 +0,0 @@ -{{define "body"}} -<main id="content"> - {{ range .Sections }} - <div class="introduction"> - <h1>{{ .Name }}</h1> - <p>{{ .Description }}</p> - </div> - {{ template "logs_display" . }} {{ end }} -</main> -{{end}} diff --git a/backend/templates/log.html b/backend/templates/log.html deleted file mode 100644 index a384459..0000000 --- a/backend/templates/log.html +++ /dev/null @@ -1,11 +0,0 @@ -{{define "body"}} -<article id="content"> - <h1>{{ .DataTitle }}</h1> - <p>{{ .Description }}</p> - <figure> - <img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" class="large" /> - <figcaption>{{ .Img.Legend }}</figcaption> - </figure> - {{ .Content }} -</article> -{{end}} |
