Skip to content
Snippets Groups Projects
Unverified Commit 829adcd7 authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

[a11y] Bloc témoignage (#778)

parent 07ac9b92
No related branches found
Tags v7.2.6
No related merge requests found
......@@ -177,12 +177,12 @@ commons:
read_online: Lire en ligne
share: Partager
slider:
default_title: Carousel
default_title: Carrousel
goto: Aller à l'élément
next: Aller à l'élément suivant
pagination_list: Pagination du carousel
pause: Carousel en cours de lecture. Mettre en pause le carousel.
play: Carousel actuellement en pause. Démarrer le carousel.
pagination_list: Pagination du carrousel
pause: Carrousel en cours de lecture. Mettre en pause le carrousel.
play: Carrousel actuellement en pause. Démarrer le carrousel.
previous: Aller à l'élément précédent
toc: Table des matières
"true": Oui
......
......@@ -12,11 +12,47 @@
)}}
<div class="testimonials" data-slider="{{ site.Params.blocks.testimonials.slider | encoding.Jsonify }}">
{{ range .testimonials }}
{{ partial "blocks/templates/testimonials/single.html" (dict
"params" .
)}}
{{ $aria_label := "" }}
{{ if and .author .job }}
{{ $aria_label = delimit (slice .author .job) ", " }}
{{ else }}
{{ with or .author .job }}
{{ $aria_label = . }}
{{ end }}
{{ end }}
<figure class="testimonial {{ if.photo }}with-picture{{ end }}"
{{ with $aria_label -}} role="figure" aria-label="{{ . }}" {{- end }}>
{{ $is_long := gt (len .text) 150 }}
<blockquote {{- if $is_long }} class="is-long" {{- end }}>
{{- partial "PrepareHTML" .text -}}
</blockquote>
{{ if or .photo .author .job -}}
<figcaption>
{{ if .photo -}}
<div class="avatar">
{{- partial "commons/image.html" (dict
"image" .photo
"sizes" site.Params.image_sizes.blocks.testimonials
) -}}
</div>
{{- end }}
{{ if or .author .job -}}
<p>
{{- if .author -}}
<span class="signature">{{ partial "PrepareHTML" .author }}</span>
{{- end }}
{{- if .job -}}
<span class="meta">{{- partial "PrepareHTML" .job -}}</span>
{{- end }}
</p>
{{- end }}
</figcaption>
{{ end }}
</figure>
{{ end }}
</div>
</div>
</div>
</div>
</div>
......
<figure class="testimonial {{ if .params.photo }}with-picture{{ end }}" {{ with .params.author -}} role="figure" aria-label="{{ . }}" {{- end }}>
{{ with .params }}
{{ $is_long := gt (len .text) 150 }}
<blockquote {{- if $is_long }} class="is-long" {{- end }}>
{{- partial "PrepareHTML" .text -}}
</blockquote>
{{ if or .photo .author .job -}}
<figcaption>
{{ if .photo -}}
<div class="avatar">
{{- partial "commons/image.html"
(dict
"image" .photo
"sizes" site.Params.image_sizes.blocks.testimonials
) -}}
</div>
{{- end }}
{{ if or .author .job -}}
<p>
{{- if .author -}}
<span class="signature">{{ partial "PrepareHTML" .author }}</span>
{{- end }}
{{- if .job -}}
<span class="meta">{{- partial "PrepareHTML" .job -}}</span>
{{- end }}
</p>
{{- end }}
</figcaption>
{{ end }}
{{ end }}
</figure>
\ No newline at end of file
......@@ -43,6 +43,7 @@
"params" (dict
"i18n" (dict
"slider" (dict
"default_title" (i18n "commons.slider.default_title")
"goto" (i18n "commons.slider.goto")
"next" (i18n "commons.slider.next")
"pagination_list" (i18n "commons.slider.pagination_list")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment