Skip to content
Snippets Groups Projects
Commit 8b46b930 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

warning

parent 8565eb4d
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,10 @@ class Communication::Block::Template::Chapter < Communication::Block::Template::
has_string :alt
has_rich_text :credit
protected
def check_accessibility
super
accessibility_warning 'accessibility.commons.alt.empty' if image_component.blob && alt.blank?
end
end
......@@ -8,7 +8,7 @@ color = about.accessible? ? 'text-success' : 'text-danger'
<%= t('accessibility.label') %>
</h2>
</div>
<% if about.accessibility_errors.any? %>
<% if about.accessibility_errors.any? || about.accessibility_warnings.any? %>
<div class="card-body">
<% if about.accessibility_errors.any? %>
<h2 class="h5 text-danger">
......@@ -27,10 +27,18 @@ color = about.accessible? ? 'text-success' : 'text-danger'
</ol>
<% end %>
<% if about.accessibility_warnings.any? %>
<h2 class="h5"><%= t 'accessibility.warnings' %></h2>
<h2 class="h5">
<%= t 'accessibility.warnings', count: about.accessibility_warnings.count %>
</h2>
<ul class="list-unstyled">
<% about.accessibility_warnings.each do |key| %>
<li><%= message %></li>
<li>
<hr>
<h3 class="h5"><%= t "#{key}.title" %></h3>
<p>
<%= t "#{key}.text_html" %>
</p>
</li>
<% end %>
</ul>
<% end %>
......
......@@ -7,6 +7,11 @@ fr:
warnings:
one: '1 information utile'
other: '%{count} informations utiles'
commons:
alt:
empty:
title: Texte alternatif vide
text_html: Vous avez une image, mais le texte alternatif est vide. C'est tout à fait pertinent s'il n'y a aucune information significative dans l'image. En revanche, si l'image contient des informations utiles, il est nécessaire de les indiquer en texte.
blocks:
components:
templates:
......
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