aboutsummaryrefslogtreecommitdiff
path: root/backend/templates
diff options
context:
space:
mode:
Diffstat (limited to 'backend/templates')
-rw-r--r--backend/templates/components.html52
-rw-r--r--backend/templates/home_section.html2
2 files changed, 39 insertions, 15 deletions
diff --git a/backend/templates/components.html b/backend/templates/components.html
index e49a8c4..bf555f0 100644
--- a/backend/templates/components.html
+++ b/backend/templates/components.html
@@ -13,27 +13,51 @@
{{ end }}
</nav>
{{ end }}
-{{ define "section_display" }}
- <article>
- {{ $uri := .URI }}
- {{ range .Data }}
- <article>
- <h3><a href="/{{ $uri }}/{{ .Slug }}">{{ .DataTitle }}</a></h3>
- <figure>
- <a href="/{{ $uri }}/{{ .Slug }}"><img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" /></a>
- <figcaption>{{ .Img.Legend }}</figcaption>
- </figure>
- <p>{{ .Description }}</p>
- </article>
- {{ end }}
+{{ define "data_display" }}
+ <article class="large">
+ <figure>
+ <a href="/{{ .URI }}/{{ .Slug }}"><img src="{{ static .Img.Src }}" alt="{{ .Img.Alt }}" /></a>
+ <figcaption>{{ .Img.Legend }}</figcaption>
+ </figure>
+ <div>
+ <h3><a href="/{{ .URI }}/{{ .Slug }}">{{ .DataTitle }}</a></h3>
+ <p>{{ .Description }}</p>
+ </div>
+ </article>
+{{ end }}
+{{ define "section_pagination" }}
<div class="pagination">
{{ if .Paginate }}
{{ template "pagination" . }}
{{ else }}
{{ if eq (len .Data) .LenMax }}
- <a href="/{{ $uri }}/">Voir plus</a>
+ <a href="/{{ .URI }}/">Voir plus</a>
{{ end }}
{{ end }}
</div>
+{{ end }}
+{{ define "section_display--no-first" }}
+ <article class="article__list">
+ {{ range .Data }}
+ {{ template "data_display" . }}
+ {{ end }}
+ {{ template "section_pagination" . }}
+ </article>
+{{ end }}
+{{ define "section_display" }}
+ <article class="article__list">
+ {{ $first := firstData .Data }}
+ <article>
+ <h3>{{ $first.DataTitle }}</h3>
+ <figure>
+ <a href="/{{ .URI }}/{{ $first.Slug }}"><img src="{{ static $first.Img.Src }}" alt="{{ $first.Img.Alt }}" /></a>
+ <figcaption>{{ $first.Img.Legend }}</figcaption>
+ </figure>
+ <p>{{ $first.Description }}</p>
+ </article>
+ {{ range restData .Data }}
+ {{ template "data_display" . }}
+ {{ end }}
+ {{ template "section_pagination" . }}
</article>
{{ end }}
diff --git a/backend/templates/home_section.html b/backend/templates/home_section.html
index 1101843..6f31fc0 100644
--- a/backend/templates/home_section.html
+++ b/backend/templates/home_section.html
@@ -5,7 +5,7 @@
<h1>{{ .Name }}</h1>
<p>{{ .Description }}</p>
</div>
- {{ template "section_display" . }}
+ {{ template "section_display--no-first" . }}
{{ end }}
</main>
{{ end }}