demarches-normaliennes/app/views/instructeurs/procedures/download_export.js.erb

25 lines
1.1 KiB
Text
Raw Normal View History

<% if @can_download_dossiers %>
<% if @statut.present? %>
<%= render_to_element('.dossiers-export', partial: "dossiers_export", locals: { procedure: @procedure, exports: @exports, statut: @statut, count: @dossiers_count }) %>
<% else %>
<%= render_to_element('.procedure-actions', partial: "download_dossiers", locals: { procedure: @procedure, exports: @exports }) %>
<% end %>
<% end %>
2020-01-29 12:16:38 +01:00
<% @exports.values.each do |exports| %>
<% if @statut.present? %>
<% export = exports[:statut][@statut] %>
<% if export && !export.ready? %>
<%= fire_event('export:update', { url: download_export_instructeur_procedure_path(@procedure, export_format: export.format, statut: export.statut, no_progress_notification: true) }.to_json) %>
<% end %>
<% else %>
<% exports[:time_span_type].values.each do |export| %>
<% if !export.ready? %>
<%= fire_event('export:update', { url: download_export_instructeur_procedure_path(@procedure, export_format: export.format, time_span_type: export.time_span_type, no_progress_notification: true) }.to_json) %>
<% end %>
2021-06-16 11:46:25 +02:00
<% end %>
2020-01-29 12:16:38 +01:00
<% end %>
<% end %>
<%= render_flash %>