correctif(a11y): #8105, pour les callout, utilise un div wrappant du contenu html

This commit is contained in:
Martin 2023-02-22 09:09:07 +01:00 committed by mfo
parent 4fd799390b
commit c8e9b2f008
7 changed files with 19 additions and 15 deletions

View file

@ -1,6 +1,7 @@
# see: https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/mise-en-avant # see: https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/mise-en-avant
class Dsfr::CalloutComponent < ApplicationComponent class Dsfr::CalloutComponent < ApplicationComponent
renders_one :body renders_one :body
renders_one :html_body
renders_one :bottom renders_one :bottom
attr_reader :title, :theme, :icon, :extra_class_names attr_reader :title, :theme, :icon, :extra_class_names

View file

@ -1,5 +1,8 @@
%div{ class: callout_class } %div{ class: callout_class }
- if title.present? - if title.present?
%h3.fr-callout__title= title %h3.fr-callout__title= title
%p.fr-callout__text= body - if html_body?
.fr-callout__text= html_body
- if body?
%p.fr-callout__text= body
= bottom = bottom

View file

@ -1,5 +1,5 @@
= render Dsfr::CalloutComponent.new(title: @champ.libelle, extra_class_names: ['fr-mb-2w', 'fr-callout--blue-cumulus']) do |c| = render Dsfr::CalloutComponent.new(title: @champ.libelle, extra_class_names: ['fr-mb-2w', 'fr-callout--blue-cumulus']) do |c|
- c.with_body do - c.with_html_body do
= render SimpleFormatComponent.new(@champ.description, allow_a: true) = render SimpleFormatComponent.new(@champ.description, allow_a: true)

View file

@ -6,12 +6,12 @@
- if @dossier.etablissement&.as_degraded_mode? - if @dossier.etablissement&.as_degraded_mode?
.container .container
= render Dsfr::CalloutComponent.new(title: "Données de lentreprise non vérifiées", theme: :warning, icon: "fr-icon-feedback-fill") do |c| = render Dsfr::CalloutComponent.new(title: "Données de lentreprise non vérifiées", theme: :warning, icon: "fr-icon-feedback-fill") do |c|
- c.with_body do - c.with_html_body do
Les services de lINSEE sont indisponibles, nous ne pouvons pas %p
vérifier les informations liées à létablissement de ce dossier. Les services de lINSEE sont indisponibles, nous ne pouvons pas vérifier les informations liées à létablissement de ce dossier.
%strong Il nest pas possible daccepter ou de refuser un dossier sans cette étape. %strong
%br Il nest pas possible daccepter ou de refuser un dossier sans cette étape.
%br %p
Les informations sur l'entreprise arriveront dici quelques heures. Les informations sur l'entreprise arriveront dici quelques heures.
= render partial: "shared/dossiers/demande", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at, profile: 'instructeur' } = render partial: "shared/dossiers/demande", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at, profile: 'instructeur' }

View file

@ -1,6 +1,6 @@
= render Dsfr::CalloutComponent.new(title: t("views.prefill_descriptions.edit.json_description_title"), theme: :success, icon: "fr-icon-layout-grid-fill") do |c| = render Dsfr::CalloutComponent.new(title: t("views.prefill_descriptions.edit.json_description_title"), theme: :success, icon: "fr-icon-layout-grid-fill") do |c|
- c.with_body do - c.with_html_body do
= t("views.prefill_descriptions.edit.json_description_info") %p= t("views.prefill_descriptions.edit.json_description_info")
%pre %pre
%code.code-block %code.code-block
= prefill_json_description_url(procedure.path) = prefill_json_description_url(procedure.path)

View file

@ -5,8 +5,8 @@
- if prefill_description.prefilled_champs.any? - if prefill_description.prefilled_champs.any?
= render Dsfr::CalloutComponent.new(title: t("views.prefill_descriptions.edit.prefill_link_title"), theme: theme, icon: icon) do |c| = render Dsfr::CalloutComponent.new(title: t("views.prefill_descriptions.edit.prefill_link_title"), theme: theme, icon: icon) do |c|
- c.with_body do - c.with_html_body do
= body %p= body
%pre %pre
%code.code-block %code.code-block
= prefill_description.prefill_link = prefill_description.prefill_link

View file

@ -3,8 +3,8 @@
- if prefill_description.prefilled_champs.any? - if prefill_description.prefilled_champs.any?
= render Dsfr::CalloutComponent.new(title: t("views.prefill_descriptions.edit.prefill_query_title"), theme: :success, icon: "fr-icon-code-box-fill") do |c| = render Dsfr::CalloutComponent.new(title: t("views.prefill_descriptions.edit.prefill_query_title"), theme: :success, icon: "fr-icon-code-box-fill") do |c|
- c.with_body do - c.with_html_body do
= t("views.prefill_descriptions.edit.prefill_query_info") %p= t("views.prefill_descriptions.edit.prefill_query_info")
%pre %pre
%code.code-block %code.code-block
= prefill_description.prefill_query = prefill_description.prefill_query