Files
grecia/app/components/admin/site_customization/images/table_actions_component.html.erb
Javi Martín b82d7032ba Add a hint to the site customization image fields
This way people using screen readers will hear the required dimensions
of the images while filling in the form.
2024-11-08 15:03:55 +01:00

22 lines
709 B
Plaintext

<div class="site-customization-images-table-actions">
<%= form_for([:admin, image], html: { id: "edit_#{dom_id(image)}" }) do |f| %>
<div>
<%= image_tag image.image if image.persisted_attachment? %>
<%= f.file_field :image,
label: false,
"aria-label": image.name,
"aria-describedby": dom_id(image, :hint) %>
</div>
<%= f.submit(t("admin.site_customization.images.index.update"), class: "button hollow") %>
<% end %>
<% if image.persisted_attachment? %>
<%= render Admin::ActionComponent.new(
:destroy,
image,
path: admin_site_customization_image_path(image)
) %>
<% end %>
</div>