demarches-normaliennes/app/views/instructeurs/procedures/_download_dossiers.html.haml

23 lines
1.5 KiB
Text
Raw Normal View History

- if procedure.dossiers.state_not_brouillon.any?
%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-07-31 15:09:03 +02:00
.dropdown-content.fade-in-down{ style: !export_v1_enabled ? 'width: 330px' : '' }
%ul.dropdown-items
2019-07-31 15:09:03 +02:00
%li
= link_to "Au format .xlsx", procedure_dossiers_download_path(procedure, format: :xlsx, version: 'v2'), target: "_blank", rel: "noopener"
%li
= link_to "Au format .ods", procedure_dossiers_download_path(procedure, format: :ods, version: 'v2'), target: "_blank", rel: "noopener"
%li
= link_to "Au format .csv", procedure_dossiers_download_path(procedure, format: :csv, version: 'v2'), 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, jusquau #{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"