demarches-normaliennes/app/views/instructeurs/procedures/_download_dossiers.html.haml
2020-09-15 18:12:26 +02:00

17 lines
1.1 KiB
Text

- if procedure.dossiers.state_not_brouillon.any?
%span.dropdown
%button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'download-menu' }
Télécharger tous les dossiers
#download-menu.dropdown-content.fade-in-down{ style: 'width: 330px' }
%ul.dropdown-items
- [[xlsx_export, :xlsx], [ods_export, :ods], [csv_export, :csv]].each do |(export, format)|
%li
- if export.nil?
- 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
- elsif export.ready?
= link_to "Télécharger l'export au format .#{format}", export.file.service_url, target: "_blank", rel: "noopener"
- else
%span{ 'data-export-poll-url': download_export_instructeur_procedure_path(procedure, export_format: format, no_progress_notification: true) }