demarches-normaliennes/app/views/attachments/show.js.erb
Pierre de La Morinerie 1c61f2de58 views: refactor the attachment/edit view
Make it more reusable, by:

- Renaming `attachment/update` to `attachment/edit`
- Refactoring the CSS styles into their own stylesheet
- Allow to specify the 'accept' option
2019-10-31 10:27:19 +01:00

8 lines
437 B
Text

<%= render_to_element(".attachment-link[data-attachment-id=\"#{@attachment.id}\"]",
partial: 'shared/attachment/show',
outer: true,
locals: { attachment: @attachment, user_can_upload: @user_can_upload }) %>
<% if @attachment.virus_scanner.pending? %>
<%= fire_event('attachment:update', { url: attachment_url(@attachment.id, { signed_id: @attachment.blob.signed_id, user_can_upload: @user_can_upload }) }.to_json ) %>
<% end %>