<%# # Image Form Partial This partial renders an input element for image attributes. By default, the input is a text field for the image's URL. ## Local variables: - `f`: A Rails form generator, used to help create the appropriate input fields. - `field`: An instance of [Administrate::Field::Image][1]. A wrapper around the image url pulled from the database. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Image %>
<%= f.label field.attribute %>
<% if field.drop_js? %> <%= render partial: 'fields/active_storage/drop_js/dropjs_items', locals: { f: f, field: field, removable: field.destroyable? } %> <%else %> <%= f.file_field field.attribute, multiple: field.many?, direct_upload: field.direct? %> <%end %> <% if field.attached? %> <% if !field.drop_js? %> <%= render partial: 'fields/active_storage/normal/items_on_show', locals: { field: field, removable: field.destroyable? } %> <%= field.can_add_attachment? ? "Add:" : "Replace:" %> <%else %> <% if request.env["PATH_INFO"].include?('edit')%> <%= render partial: 'fields/active_storage/drop_js/drop_js_items_on_edit', locals: { field: field, removable: field.destroyable? } %> <% else %> <%= render partial: 'fields/active_storage/drop_js/drop_js_items_on_show', locals: { field: field, removable: field.destroyable? } %> <% end %> <%end %> <% end %>