diff --git a/app/views/admin/application/a11y/_status.html.erb b/app/views/admin/application/a11y/_status.html.erb index 20ae8394f155e52ec7d84c369b01434f13e31765..3fc893ec1a825e498cf1adaa61ea5c72a7c1265e 100644 --- a/app/views/admin/application/a11y/_status.html.erb +++ b/app/views/admin/application/a11y/_status.html.erb @@ -1,7 +1,9 @@ -<% -$color = about.accessible? ? 'text-success' : 'text-danger' -%> <span class="small a11y__status"> - <i class="a11y__status__icon lead fas fa-universal-access <%= $color %>"></i> - <%= t "accessibility.status.#{about.accessible?}" %> + <% if about.accessibility_errors.any? %> + <i class="fas fa-universal-access text-danger"></i> + <%= t "accessibility.status.false" %> + <% elsif about.accessibility_warnings.any? %> + <i class="fas fa-universal-access text-muted"></i> + <%= t "accessibility.status.warnings" %> + <% end %> </span> diff --git a/app/views/admin/communication/blocks/_block.html.erb b/app/views/admin/communication/blocks/_block.html.erb index e30429f59c0a93987aec5f59f69ca196e3a410a0..2d09f4cefbb6ce88d452c7c95a4ecd1d26c9a647 100644 --- a/app/views/admin/communication/blocks/_block.html.erb +++ b/app/views/admin/communication/blocks/_block.html.erb @@ -26,7 +26,7 @@ <div class="content-editor__elements__preview"> <%= render "admin/communication/blocks/templates/#{block.template_kind}/snippet", block: block %> </div> - <%= render 'admin/application/a11y/status', about: block unless block.accessible? %> + <%= render 'admin/application/a11y/status', about: block %> </article> </div> </div> diff --git a/config/locales/en.yml b/config/locales/en.yml index 513d037df47024c3f8f51fac69e103a2d0df4b54..a17fc0017a3d0d2ac35a7c0833ad603f5bbc65da 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -8,6 +8,7 @@ en: status: true: Accessible false: Not accessible + warnings: Needs checking warnings: one: '1 insight' other: '%{count} insights' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index ca83d5a78a5ca19c73daa7b822c39220be0b0de1..1844ef2ec3bc1244f1ff5c88fd7992de71f45b64 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -8,6 +8,7 @@ fr: status: true: Accessible false: Non accessible + warnings: À vérifier warnings: one: '1 information utile' other: '%{count} informations utiles'