Files
nairobi/app/components/images/nested_component.html.erb
Javi Martín a8bd5eb192 Rename document/image fields HTML classes
Using the `document` or `documents` classes meant styles defined for the
public list of documents conflict with these ones.

So now we're using HTML classes that match the name of the Ruby
component classes, as we usually do.
2023-10-23 15:49:01 +02:00

25 lines
1.1 KiB
Plaintext

<fieldset class="images-nested">
<legend><%= t("images.form.title") %></legend>
<p class="help-text"><%= note %></p>
<div id="nested-image">
<%= f.fields_for image_fields do |image_builder| %>
<%= render Images::FieldsComponent.new(image_builder, imageable: imageable) %>
<% end %>
</div>
<%= link_to_add_association t("images.form.add_new_image"), f, image_fields,
force_non_association_create: true,
partial: "images/image_fields",
id: "new_image_link",
class: "button upload-image
#{"hide" if image_fields == :image && imageable.image.present?}",
render_options: {
locals: { imageable: imageable }
},
data: {
association_insertion_node: "#nested-image",
association_insertion_method: "append"
} %>
</fieldset>