demarches-normaliennes/app/views/instructeurs/procedures/_download_dossiers.html.haml
Kara Diaby 3f2ef985c7 layout
2022-04-14 10:22:37 +02:00

34 lines
2.4 KiB
Text

%span.dropdown
%button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'download-menu' }
= t('.download')
#download-menu.dropdown-content.fade-in-down{ style: 'width: 450px' }
%ul.dropdown-items
- exports_list(exports).each do |item|
- format = item[:format]
- time_span_type = item[:time_span_type]
- export = item[:export]
%li
- if export.nil?
// 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
- elsif export.ready?
// 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"
- if export.old?
// 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
.icon.retry
- else
%span{ 'data-export-poll-url': download_export_instructeur_procedure_path(procedure, export_format: format, time_span_type: time_span_type, no_progress_notification: true) }
// 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}")
%li
= link_to t(".download_archive"), instructeur_archives_path(procedure)