demarches-normaliennes/app/views/champs/piece_justificative/show.js.erb

18 lines
683 B
Text
Raw Normal View History

<% dossier = @champ.dossier %>
<%= fields_for dossier do |form| %>
<%= form.fields_for :champs, dossier.champs.where(id: @champ.id), include_id: false do |champ_form| %>
<% render_to_element(".editable-champ[data-champ-id=\"#{@champ.id}\"]",
partial: 'shared/dossiers/editable_champs/editable_champ',
locals: {
champ: @champ,
form: champ_form
}) %>
<% end %>
<% end %>
<% attachment = @champ.piece_justificative_file.attachment %>
<% if attachment.virus_scanner.pending? %>
<%= fire_event('attachment:update', { url: attachment_url(attachment.id, { signed_id: attachment.blob.signed_id, user_can_upload: true }) }.to_json ) %>
<% end %>