2022-06-23 13:51:58 +02:00
|
|
|
%table.table.hoverable.archive-table
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th
|
|
|
|
%th.text-right Nombre de dossiers terminés
|
|
|
|
%th.text-right Poids estimé
|
|
|
|
%th.center Télécharger
|
|
|
|
|
|
|
|
%tbody
|
2022-10-31 17:02:48 +01:00
|
|
|
- count_dossiers_termines_by_month.each do |date, count|
|
2022-11-02 14:04:52 +01:00
|
|
|
- matching_archive = archives.find { |archive| archive.time_span_type == 'monthly' && archive.month == date }
|
2022-10-31 17:02:48 +01:00
|
|
|
- weight = estimate_weight(matching_archive, count, average_dossier_weight)
|
2022-06-23 13:51:58 +02:00
|
|
|
|
|
|
|
%tr
|
|
|
|
%td
|
2022-10-31 17:02:48 +01:00
|
|
|
= I18n.l(date, format: "%B %Y").capitalize
|
2022-06-23 13:51:58 +02:00
|
|
|
%td.text-right
|
2022-10-31 17:02:48 +01:00
|
|
|
= count
|
2022-06-23 13:51:58 +02:00
|
|
|
%td.text-right
|
|
|
|
= number_to_human_size(weight)
|
|
|
|
%td.center
|
|
|
|
- if matching_archive.present?
|
2022-07-07 18:15:48 +02:00
|
|
|
- if matching_archive.available?
|
2023-11-27 14:51:39 +01:00
|
|
|
= link_to url_for(matching_archive.file), class: 'fr-btn fr-btn--secondary fr-icon-download-line fr-btn--icon-left fr-btn--sm' do
|
2022-06-23 13:51:58 +02:00
|
|
|
= t(:archive_ready_html, scope: [:instructeurs, :procedure], generated_period: time_ago_in_words(matching_archive.updated_at))
|
|
|
|
- else
|
2023-11-27 14:51:39 +01:00
|
|
|
= dsfr_icon("fr-icon-flashlight-line", :sm)
|
2022-06-23 13:51:58 +02:00
|
|
|
= t(:archive_pending_html, scope: [:instructeurs, :procedure], created_period: time_ago_in_words(matching_archive.created_at))
|
2022-07-27 12:13:59 +02:00
|
|
|
- elsif weight.nil? || weight < Archive::MAX_SIZE
|
2023-11-27 14:51:39 +01:00
|
|
|
= link_to "Demander la création", create_archive_url(procedure, date), method: :post, class: "fr-btn fr-btn--secondary fr-icon-download-line fr-btn--icon-left fr-btn--sm"
|
2022-06-23 13:51:58 +02:00
|
|
|
- else
|
|
|
|
Archive trop volumineuse
|