<% form ||= current_fields_form options ||= {} other_options ||= {} %> <%= render 'shared/fields/field', form: form, method: method, helper: :file_field, options: options, other_options: other_options do %> <% content_for :field do %>
<%= form.hidden_field "#{method}_removal".to_sym, value: nil, data: {'fields--file-field-target': 'removeFileFlag'} %> <%= form.file_field method, class: 'file-upload hidden', direct_upload: true, data: {'fields--file-field-target': 'fileField', action: 'change->fields--file-field#handleFileSelected'} %>
<% if form.object.send(method).attached? %> <%= link_to url_for(form.object.send(method)), class: 'button download-file mr-3', data: {'fields--file-field-target': 'downloadFileButton'} do %> <%= t('fields.download_document') %> <% end %> <% end %> <% if form.object.send(method).attached? %> <% if form.object.send(method).representable? %>
<%= image_tag(form.object.send(method).representation(resize_to_limit: [200, 200])) %>
<% end %>
<%= t('fields.remove_document') %>
<% end %>
<%= t('fields.upload_document') %>
<% end %> <% end %>