Add alt test to proposal images in mail

This commit is contained in:
Javi Martín
2024-10-12 22:24:43 +02:00
parent 6d6c067296
commit a6e6a90bef
2 changed files with 11 additions and 3 deletions

View File

@@ -15,9 +15,13 @@
</table> </table>
<% if @proposal.image.present? %> <% if @proposal.image.present? %>
<%= image_tag @proposal.image.variant(:large), style: "width: 100%; box-shadow: -16px 61px 49px -19px rgba(0,0,0,0.1);" %> <%= image_tag @proposal.image.variant(:large),
alt: @proposal.image.title.unicode_normalize,
style: "width: 100%; box-shadow: -16px 61px 49px -19px rgba(0,0,0,0.1);" %>
<% else %> <% else %>
<%= image_tag "default_mailing.jpg", style: "width: 100%; box-shadow: -16px 61px 49px -19px rgba(0,0,0,0.1);" %> <%= image_tag "default_mailing.jpg",
alt: "",
style: "width: 100%; box-shadow: -16px 61px 49px -19px rgba(0,0,0,0.1);" %>
<% end %> <% end %>
<p style="padding: 0 50px; font-size:32px; text-align: left; line-height:43px; color: #515151;"><%= t("dashboard.mailer.forward.hi") %></p> <p style="padding: 0 50px; font-size:32px; text-align: left; line-height:43px; color: #515151;"><%= t("dashboard.mailer.forward.hi") %></p>

View File

@@ -9,7 +9,11 @@
</div> </div>
<div class="margin-bottom"> <div class="margin-bottom">
<%= image_tag(proposal.image&.variant(:large).presence || "default_mailing.jpg") %> <% if proposal.image.present? %>
<%= image_tag(proposal.image.variant(:large), alt: proposal.image.title.unicode_normalize) %>
<% else %>
<%= image_tag("default_mailing.jpg", alt: "") %>
<% end %>
</div> </div>
<div class="mail-body"> <div class="mail-body">