diff --git a/app/models/communication/block/template/call_to_action.rb b/app/models/communication/block/template/call_to_action.rb index 867996d329cfefdde586439b1131147657edd3a2..a16e87e65784202cc523978013d75bfbea423c8e 100644 --- a/app/models/communication/block/template/call_to_action.rb +++ b/app/models/communication/block/template/call_to_action.rb @@ -7,4 +7,9 @@ class Communication::Block::Template::CallToAction < Communication::Block::Templ has_elements Communication::Block::Template::CallToAction::Button + def check_accessibility + super + accessibility_warning 'accessibility.commons.alt.empty' if image_component.blob && alt.blank? + end + end diff --git a/app/models/communication/block/template/embed.rb b/app/models/communication/block/template/embed.rb index c6eb762df8f1325b0a833ed255e098a8479b6919..8f48cc8f3f68c994eba27f652140f117a9f84cba 100644 --- a/app/models/communication/block/template/embed.rb +++ b/app/models/communication/block/template/embed.rb @@ -4,4 +4,10 @@ class Communication::Block::Template::Embed < Communication::Block::Template::Ba has_component :iframe_title, :string has_component :transcription, :text + def check_accessibility + super + accessibility_error 'accessibility.blocks.templates.embed.title_missing' if iframe_title.blank? + accessibility_error 'accessibility.blocks.templates.embed.transcription_missing' if transcription.blank? + end + end diff --git a/app/models/communication/block/template/gallery/image.rb b/app/models/communication/block/template/gallery/image.rb index c46f4d3e9a7f96ef9aa215af89d20e7c7c861b68..2761a441bfe06f7eb1c8e11fed1dc9e2144fa442 100644 --- a/app/models/communication/block/template/gallery/image.rb +++ b/app/models/communication/block/template/gallery/image.rb @@ -7,4 +7,10 @@ class Communication::Block::Template::Gallery::Image < Communication::Block::Tem def blob image_component.blob end + + def check_accessibility + super + accessibility_warning 'accessibility.commons.alt.empty' if image_component.blob && alt.blank? + end + end diff --git a/app/models/communication/block/template/image.rb b/app/models/communication/block/template/image.rb index dea57cb132ce2ee6cd5f1dc91e7d0d9539bae3c7..ea534a8901d8ec12c4f589a5fb16d772caddbd90 100644 --- a/app/models/communication/block/template/image.rb +++ b/app/models/communication/block/template/image.rb @@ -5,4 +5,9 @@ class Communication::Block::Template::Image < Communication::Block::Template::Ba has_component :credit, :rich_text has_component :text, :text + def check_accessibility + super + accessibility_warning 'accessibility.commons.alt.empty' if image_component.blob && alt.blank? + end + end diff --git a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb index 5f59df06aa11a015350e9c9c5ac922c16b23c32f..c685d8e130e2cf5a9dd7d2c8d25a70c0d9ba007d 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_edit.html.erb @@ -21,7 +21,9 @@ </div> <div class="card-body"> <%= block_component_edit :image, - template: element %> + template: element, + label: t('admin.communication.blocks.components.image.input.label'), + placeholder: t('admin.communication.blocks.components.image.input.placeholder') %> <%= block_component_edit :alt, template: element, label: t('admin.communication.blocks.components.image.alt.label'), diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 52fa7ac494faa475e8ad8207e23d6d123368857f..e25d924fc7aeefedfdec22bf1c548f8ef7dfd88f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -22,6 +22,14 @@ fr: transcription_missing: title: Pas de transcription text_html: La vidéo n'est pas accompagnée d'une transcription textuelle pour les personnes malvoyantes, ou pour les situations de faible débit qui empêcheraient la lecture. + embed: + title_missing: + title: Pas de titre de cadre + text_html: L'intégration HTML n'a pas de titre, cela va empêcher les personnes malvoyantes de savoir de quoi parle la vidéo, comme expliqué dans le <a href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/methode-rgaa/criteres/#topic4" target="_blank">critère 4.7 du RGAA</a>. Merci d'ajouter un titre à la vidéo. + transcription_missing: + title: Pas de transcription + text_html: Le cadre HTML n'est pas accompagné d'une transcription textuelle pour les personnes malvoyantes, ou pour les situations de faible débit qui empêcheraient la lecture. + activerecord: attributes: