2017-11-28 10:24:36 +01:00
|
|
|
- if procedure.dossiers.state_not_brouillon.any?
|
2018-09-11 17:51:44 +02:00
|
|
|
%span.dropdown
|
2020-09-14 11:28:24 +02:00
|
|
|
%button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'download-menu' }
|
2018-09-11 17:51:44 +02:00
|
|
|
Télécharger tous les dossiers
|
2020-09-14 11:28:24 +02:00
|
|
|
#download-menu.dropdown-content.fade-in-down{ style: 'width: 330px' }
|
2017-11-28 10:24:36 +01:00
|
|
|
%ul.dropdown-items
|
2020-02-24 10:23:16 +01:00
|
|
|
- [[xlsx_export, :xlsx], [ods_export, :ods], [csv_export, :csv]].each do |(export, format)|
|
2019-12-11 17:42:44 +01:00
|
|
|
%li
|
|
|
|
- if export.nil?
|
2020-02-24 10:23:16 +01:00
|
|
|
- export_text = "Demander un export au format .#{format}"
|
|
|
|
- if format == :csv
|
|
|
|
- export_text = "Demander un export au format .#{format}<br/>(uniquement les dossiers, sans les champs répétables)".html_safe
|
|
|
|
= link_to export_text, download_export_instructeur_procedure_path(procedure, export_format: format), remote: true
|
2019-12-11 17:42:44 +01:00
|
|
|
- elsif export.ready?
|
2020-01-29 12:16:38 +01:00
|
|
|
= link_to "Télécharger l'export au format .#{format}", export.file.service_url, target: "_blank", rel: "noopener"
|
2019-10-03 15:35:31 +02:00
|
|
|
- else
|
2020-01-29 12:16:38 +01:00
|
|
|
%span{ 'data-export-poll-url': download_export_instructeur_procedure_path(procedure, export_format: format, no_progress_notification: true) }
|