demarches-normaliennes/app/views/champs/piece_justificative/show.js.erb
Pierre de La Morinerie ded65cfdb9 dossier: fix rendering of piece_justificative in repetition
In repetitions we can't render the piece_justificative champ in the way
we do for normal champs (which was already a bit hackish).

Instead we render the whole form partial – and then extract the champ
from the form. In this way, we're sure to render the champ as it
appears in the form, without any hacks to reproduce the form structure.
2020-04-06 11:50:31 +02:00

6 lines
299 B
Text

<%= render_champ(@champ) %>
<% 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 %>