<%= tag.strong label unless has_title? %>
<% attachments.each do |attachment| %> <% next if attachment.is_a? Array %>
<% if has_title? %> <%= title_for(attachment) %> (<%= truncated_file_name_for(attachment) %>) <%= form.hidden_field attribute, multiple: true, value: attachment.id, id: attachment.id %> <% else %> <% if blob(attachment).image? %> <%= truncated_file_name_for(attachment, 15) %> <% else %> <%= link_to truncated_file_name_for(attachment), file_attachment_path(attachment) %> <% end %> <% end %>
<% end %>
<%= tag.button button_label, id: button_id, name: attribute, class: button_class, type: "button", data: { open: modal_id, upload: { add_attribute: add_attribute, resource_name: resource_name, resource_class: resource_class, required: required?, optional: optional, max_file_size: max_file_size, multiple: multiple, titled: has_title?, form_object_class: form_object_class }.transform_keys { |key| key.to_s.camelize(:lower) } } %> <%= input_validation_field unless optional %>
<% if !has_title? && file_attachment_path(attachments.first) && blob(attachments.first).image? %> <%= attachment_label %> <%= link_to image_tag(file_attachment_path(attachments.first), alt: attribute), file_attachment_path(attachments.first) %> <% elsif !has_title? && uploader_default_image_path(attribute).present? %> <%= t("default_image", scope: "decidim.forms") %> <%= link_to uploader_default_image_path(attribute) do %> <%= image_tag uploader_default_image_path(attribute) %> <% end %> <% end %>