From e4b8f377171955a7ab20baa090b16440efe3aa87 Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Thu, 15 Jun 2023 09:42:41 +0200 Subject: [PATCH] set block html --- i18n/en.yml | 2 ++ i18n/fr.yml | 2 ++ layouts/partials/blocks/templates/sound.html | 36 ++++++++++++++++++++ layouts/partials/blocks/templates/video.html | 1 - 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/blocks/templates/sound.html diff --git a/i18n/en.yml b/i18n/en.yml index be31ab20..ec842749 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -29,6 +29,8 @@ blocks: title: Posts programs: title: Programs + sound: + title: Audio testimonials: title: Testimonials timeline: diff --git a/i18n/fr.yml b/i18n/fr.yml index 37dc88ea..62d09ccc 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -29,6 +29,8 @@ blocks: title: Actualités programs: title: Formations + sound: + title: Son testimonials: title: Témoignages timeline: diff --git a/layouts/partials/blocks/templates/sound.html b/layouts/partials/blocks/templates/sound.html new file mode 100644 index 00000000..40d7cf60 --- /dev/null +++ b/layouts/partials/blocks/templates/sound.html @@ -0,0 +1,36 @@ +{{- $template := .block.template -}} +{{- $position := .block.position -}} +{{- $title := .block.title -}} +{{- with .block.data -}} + <section class="block block-sound{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> + <div class="container"> + <div class="block-content"> + <div> + {{- if not $title -}} + {{ partial "blocks/default_title.html" $template }} + {{ else }} + <div class="top"> + <h2>{{ partial "PrepareHTML" $title }}</h2> + </div> + {{ end -}} + + {{ if .file }} + {{ $file := partial "GetMedia" .file.id }} + {{ if $file }} + <audio src="{{ $file.url }}" controls title="{{ partial "PrepareText" .title }}"></audio> + {{ end }} + {{ end }} + + {{ if .sound_title }} + <p>{{- partial "PrepareHTML" .sound_title -}}</p> + {{ end }} + + {{ partial "commons/transcription" ( dict + "transcription" .transcription + "position" $position + ) }} + </div> + </div> + </div> + </section> +{{- end -}} diff --git a/layouts/partials/blocks/templates/video.html b/layouts/partials/blocks/templates/video.html index 30ecaf09..a9e6093e 100644 --- a/layouts/partials/blocks/templates/video.html +++ b/layouts/partials/blocks/templates/video.html @@ -1,7 +1,6 @@ {{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} -{{/* TODO A11Y: vérifier d'ajouter toujours un titre adjacent à la vidéo */}} {{- with .block.data -}} <section class="block block-video{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}"> <div class="container"> -- GitLab