From 24fa7450c74e46222c351d0f8c798da8794cd01f Mon Sep 17 00:00:00 2001 From: Marcelo Paiva Date: Mon, 9 Feb 2026 13:25:13 -0500 Subject: [PATCH] Add alt text to all images in Rails ERB views Fixed 8 images missing alt attributes across Rails views: - submissions/show.html.erb (4 images): * Document preview thumbnails in sidebar * Document page images in main viewer * Signature/initials field images in parties view * Image/stamp/KBA attachment images in parties view - profile/index.html.erb (2 images): * User's signature preview * User's initials preview - submissions/_value.html.erb (2 images): * Signature field images with metadata * Image/initials/stamp/KBA field images - submit_form/show.html.erb (1 image): * Document page images in submission form All alt text uses dynamic field names and descriptive defaults with i18n support. This satisfies WCAG 2.2 Success Criterion 1.1.1 (Non-text Content, Level A). Co-Authored-By: Claude Sonnet 4.5 --- app/views/profile/index.html.erb | 4 ++-- app/views/submissions/_value.html.erb | 4 ++-- app/views/submissions/show.html.erb | 8 ++++---- app/views/submit_form/show.html.erb | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/profile/index.html.erb b/app/views/profile/index.html.erb index 9f1ec645..1a30a1ca 100644 --- a/app/views/profile/index.html.erb +++ b/app/views/profile/index.html.erb @@ -36,7 +36,7 @@ <% if signature %>
<%= button_to button_title(title: t('remove'), disabled_with: t('removing')), user_signature_path, method: :delete, class: 'right-0 top-0 absolute link' %> - + <%= t('your_signature') %>
<% end %> @@ -49,7 +49,7 @@ <% if initials %>
<%= button_to button_title(title: t('remove'), disabled_with: t('removing')), user_initials_path, method: :delete, class: 'right-0 top-0 absolute link' %> - + <%= t('your_initials') %>
<% end %>
diff --git a/app/views/submissions/_value.html.erb b/app/views/submissions/_value.html.erb index a0b3205d..8e6ddc9f 100644 --- a/app/views/submissions/_value.html.erb +++ b/app/views/submissions/_value.html.erb @@ -10,7 +10,7 @@ <% is_narrow = area['h'].positive? && ((area['w'] * local_assigns[:page_width]).to_f / (area['h'] * local_assigns[:page_height])) > 4.5 %>
- + <%= field['name'].presence || t('signature_field') %>
<% if (local_assigns[:with_signature_id] || field.dig('preferences', 'reason_field_uuid').present?) && attachment = attachments_index[value] %>
@@ -34,7 +34,7 @@ <% end %>
<% elsif field['type'].in?(['image', 'initials', 'stamp', 'kba']) && attachments_index[value].image? %> - + <%= field['name'].presence || t(" loading="lazy"> <% elsif field['type'].in?(['file', 'payment', 'image']) %>
diff --git a/app/views/submissions/show.html.erb b/app/views/submissions/show.html.erb index a40d0c9a..eabe1cd1 100644 --- a/app/views/submissions/show.html.erb +++ b/app/views/submissions/show.html.erb @@ -81,7 +81,7 @@ <% document = @submission.schema_documents.find { |a| item['attachment_uuid'] == a.uuid } %> <% if document.preview_images.first %> - + <%= t('preview_of') %> <%= item['name'].presence || document.filename.base %>
<%= item['name'].presence || document.filename.base %>
@@ -105,7 +105,7 @@ <% (document.metadata.dig('pdf', 'number_of_pages') || (document.preview_images.loaded? ? preview_images_index.size : document.preview_images.size)).times do |index| %> <% page = preview_images_index[index] || page_blob_struct.new(metadata: lazyload_metadata, url: preview_document_page_path(document.signed_uuid, "#{index}.jpg")) %> " class="block before:border before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:rounded relative mb-4" style="container-type: size; aspect-ratio: <%= width = page.metadata['width'] %> / <%= height = page.metadata['height'] %>"> - + <%= t('page') %> <%= index + 1 %> <%= t('of') %> <%= item['name'].presence || document.filename.base %>
<% document_annots_index[index]&.each do |annot| %> <%= render 'submissions/annotation', annot: %> @@ -260,10 +260,10 @@
<% if field['type'].in?(%w[signature initials]) %>
- + <%= field['name'].presence || t(" loading="lazy">
<% elsif field['type'].in?(['image', 'stamp', 'kba']) && attachments_index[value].image? %> - + <%= field['name'].presence || t(" loading="lazy"> <% elsif field['type'].in?(['file', 'payment', 'image']) %>
<% Array.wrap(value).each do |val| %> diff --git a/app/views/submit_form/show.html.erb b/app/views/submit_form/show.html.erb index 9e73f00d..0723870a 100644 --- a/app/views/submit_form/show.html.erb +++ b/app/views/submit_form/show.html.erb @@ -67,7 +67,7 @@ <% (document.metadata.dig('pdf', 'number_of_pages') || (document.preview_images.loaded? ? preview_images_index.size : document.preview_images.size)).times do |index| %> <% page = preview_images_index[index] || page_blob_struct.new(metadata: lazyload_metadata, url: preview_document_page_path(document.signed_uuid, "#{index}.jpg")) %> - + <%= t('page') %> <%= index + 1 %> <%= t('of') %> <%= item['name'].presence || document.filename.base %>
<% if annots = document_annots_index[index] %> <%= render 'submit_form/annotations', annots: %>