2021-04-22 08:38:34 +02:00
|
|
|
- if dossier_count > 0
|
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?
|
2021-04-08 12:47:29 +02:00
|
|
|
= link_to t("#{format}_html", scope: [:instructeurs, :procedure, :export_stale]), download_export_instructeur_procedure_path(procedure, export_format: format), remote: true
|
2019-12-11 17:42:44 +01:00
|
|
|
- elsif export.ready?
|
2021-04-08 12:47:29 +02:00
|
|
|
= link_to t(:export_ready_html, export_time: time_ago_in_words(export.updated_at), export_format: ".#{format}", scope: [:instructeurs, :procedure]), export.file.service_url, target: "_blank", rel: "noopener"
|
|
|
|
- if export.old?
|
|
|
|
= button_to download_export_instructeur_procedure_path(procedure, export_format: format, force_export: true), class: "button small", style: "padding-right: 2px", title: t(:short, export_format: ".#{format}", scope: [:instructeurs, :procedure, :export_stale]), remote: true, method: :get, params: { export_format: format, force_export: true } do
|
|
|
|
.icon.retry
|
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) }
|
2021-04-08 12:47:29 +02:00
|
|
|
= t(:export_pending_html, export_time: time_ago_in_words(export.created_at), export_format: ".#{format}", scope: [:instructeurs, :procedure])
|