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
|
|
|
|
|
%button.button.dropdown-button
|
|
|
|
|
Télécharger tous les dossiers
|
2019-04-03 14:29:30 +02:00
|
|
|
|
- old_format_limit_date = Date.parse("Oct 31 2019")
|
|
|
|
|
- export_v1_enabled = old_format_limit_date > Time.zone.today
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- export_v2_enabled = Flipper[:procedure_export_v2_enabled] || !export_v1_enabled
|
2019-07-31 15:09:03 +02:00
|
|
|
|
.dropdown-content.fade-in-down{ style: !export_v1_enabled ? 'width: 330px' : '' }
|
2017-11-28 10:24:36 +01:00
|
|
|
|
%ul.dropdown-items
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- if export_v2_enabled
|
|
|
|
|
%li
|
|
|
|
|
- if procedure.xlsx_export_stale?
|
|
|
|
|
- if procedure.xlsx_export_queued?
|
2019-10-16 11:40:19 +02:00
|
|
|
|
L'export au format .xlsx est en cours de préparation, vous recevrez un email lorsqu'il sera disponible.
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- else
|
2019-10-16 11:40:19 +02:00
|
|
|
|
= link_to "Exporter au format .xlsx", download_export_instructeur_procedure_path(procedure, export_format: :xlsx), remote: true
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- else
|
|
|
|
|
= link_to "Au format .xlsx", url_for(procedure.xlsx_export_file), target: "_blank", rel: "noopener"
|
|
|
|
|
%li
|
|
|
|
|
- if procedure.ods_export_stale?
|
|
|
|
|
- if procedure.ods_export_queued?
|
2019-10-16 11:40:19 +02:00
|
|
|
|
L'export au format .ods est en cours de préparation, vous recevrez un email lorsqu'il sera disponible.
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- else
|
2019-10-22 12:15:49 +02:00
|
|
|
|
= link_to "Exporter au format .ods", download_export_instructeur_procedure_path(procedure, export_format: :ods), remote: true
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- else
|
|
|
|
|
= link_to "Au format .ods", url_for(procedure.ods_export_file), target: "_blank", rel: "noopener"
|
|
|
|
|
%li
|
|
|
|
|
- if procedure.csv_export_stale?
|
|
|
|
|
- if procedure.csv_export_queued?
|
2019-10-16 11:40:19 +02:00
|
|
|
|
L'export au format .csv est en cours de préparation, vous recevrez un email lorsqu'il sera disponible.
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- else
|
2019-10-22 12:15:49 +02:00
|
|
|
|
= link_to "Exporter au format .csv", download_export_instructeur_procedure_path(procedure, export_format: :csv), remote: true
|
2019-10-03 15:35:31 +02:00
|
|
|
|
- else
|
|
|
|
|
= link_to "Au format .csv", url_for(procedure.csv_export_file), target: "_blank", rel: "noopener"
|
2019-04-03 14:29:30 +02:00
|
|
|
|
- if export_v1_enabled
|
2019-07-31 15:09:03 +02:00
|
|
|
|
- old_format_message = "(ancien format, jusqu’au #{old_format_limit_date.strftime('%d/%m/%Y')})"
|
2019-04-03 14:29:30 +02:00
|
|
|
|
%li
|
|
|
|
|
= link_to "Au format .xlsx #{old_format_message}", procedure_dossiers_download_path(procedure, format: :xlsx, version: 'v1'), target: "_blank", rel: "noopener"
|
|
|
|
|
%li
|
|
|
|
|
= link_to "Au format .ods #{old_format_message}", procedure_dossiers_download_path(procedure, format: :ods, version: 'v1'), target: "_blank", rel: "noopener"
|
|
|
|
|
%li
|
|
|
|
|
= link_to "Au format .csv #{old_format_message}", procedure_dossiers_download_path(procedure, format: :csv, version: 'v1'), target: "_blank", rel: "noopener"
|