2022-03-09 10:25:48 +01:00
|
|
|
%span.dropdown
|
|
|
|
%button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'download-menu' }
|
2022-04-13 15:44:29 +02:00
|
|
|
= t('.download')
|
2022-03-09 10:25:48 +01:00
|
|
|
#download-menu.dropdown-content.fade-in-down{ style: 'width: 450px' }
|
|
|
|
%ul.dropdown-items
|
2022-04-05 15:57:19 +02:00
|
|
|
- exports_list(exports).each do |item|
|
|
|
|
- format = item[:format]
|
|
|
|
- time_span_type = item[:time_span_type]
|
|
|
|
- export = item[:export]
|
2022-03-09 10:25:48 +01:00
|
|
|
%li
|
|
|
|
- if export.nil?
|
2022-04-13 15:44:29 +02:00
|
|
|
// i18n-tasks-use t('.everything_csv_html')
|
|
|
|
// i18n-tasks-use t('.monthly_csv_html')
|
|
|
|
// i18n-tasks-use t('.everything_xlsx_html')
|
|
|
|
// i18n-tasks-use t('.monthly_xlsx_html')
|
|
|
|
// i18n-tasks-use t('.everything_ods_html')
|
|
|
|
// i18n-tasks-use t('.monthly_ods_html')
|
|
|
|
= link_to t(".#{time_span_type}_#{format}_html"), download_export_instructeur_procedure_path(procedure, time_span_type: time_span_type, export_format: format), remote: true
|
2022-03-09 10:25:48 +01:00
|
|
|
- elsif export.ready?
|
2022-04-13 15:44:29 +02:00
|
|
|
// i18n-tasks-use t('.export_everything_ready_html')
|
|
|
|
// i18n-tasks-use t('.export_monthly_ready_html')
|
|
|
|
= link_to t(".export_#{time_span_type}_ready_html", export_time: time_ago_in_words(export.updated_at), export_format: ".#{format}"), export.file.service_url, target: "_blank", rel: "noopener"
|
2022-03-09 10:25:48 +01:00
|
|
|
- if export.old?
|
2022-04-13 15:44:29 +02:00
|
|
|
// i18n-tasks-use t('.everything_short')
|
|
|
|
// i18n-tasks-use t('.monthly_short')
|
|
|
|
= button_to download_export_instructeur_procedure_path(procedure, export_format: format, time_span_type: time_span_type, force_export: true), class: "button small", style: "padding-right: 2px", title: t(".#{time_span_type}_short", export_format: ".#{format}"), remote: true, method: :get, params: { export_format: format, time_span_type: time_span_type, force_export: true } do
|
2022-03-09 10:25:48 +01:00
|
|
|
.icon.retry
|
|
|
|
- else
|
2022-04-05 15:57:19 +02:00
|
|
|
%span{ 'data-export-poll-url': download_export_instructeur_procedure_path(procedure, export_format: format, time_span_type: time_span_type, no_progress_notification: true) }
|
2022-04-13 15:44:29 +02:00
|
|
|
// i18n-tasks-use t('.export_everything_pending_html')
|
|
|
|
// i18n-tasks-use t('.export_monthly_pending_html')
|
|
|
|
= t(".export_#{time_span_type}_pending_html", export_time: time_ago_in_words(export.created_at), export_format: ".#{format}")
|
2022-03-18 16:04:31 +01:00
|
|
|
%li
|
2022-04-13 15:44:29 +02:00
|
|
|
= link_to t(".download_archive"), instructeur_archives_path(procedure)
|