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

Bloc son : correction a11y (#768)

parent 0d285e03
No related branches found
No related tags found
No related merge requests found
{{- $block := .block -}}
{{- $block_class := partial "GetBlockClass" .block -}}
{{- $block_index := .index -}}
{{- $described_by_id := "" -}}
{{- with .block.data -}}
<div class="{{ $block_class }}">
......@@ -20,11 +21,13 @@
{{ end }}
{{ if .title }}
<p>{{- partial "PrepareHTML" .title -}}</p>
{{ $described_by_id = printf "block-sound-title-%d" $block_index }}
<p aria-hidden="true" id="{{- $described_by_id -}}">{{- partial "PrepareHTML" .title -}}</p>
{{ end }}
{{ partial "commons/transcription" ( dict
"block_index" $block_index
"described_by" $described_by_id
"transcription" .transcription
) }}
</div>
......
{{ if (partial "GetTextFromHTML" .transcription) }}
{{ $block_index := .block_index }}
{{ $id := printf "block-%d-transcription" $block_index}}
{{ $id := printf "block-%d-transcription" $block_index }}
{{ $title := .title | default ( i18n "commons.accessibility.transcription" ) }}
<div class="transcription">
<details id="{{- $id -}}">
<summary aria-controls="{{- $id -}}" aria-expanded="false">{{ $title }}</summary>
<summary
aria-controls="{{- $id -}}"
aria-expanded="false"
{{ with .described_by -}}aria-describedby="{{ . }}"{{- end }}>
{{ $title }}
</summary>
{{- $transcription := partial "PrepareHTML" .transcription -}}
{{ safeHTML $transcription }}
</details>
......
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