2021-04-29 17:29:47 +02:00
|
|
|
|
- content_for(:title, "Archives pour #{@procedure.libelle}")
|
|
|
|
|
|
|
|
|
|
= render partial: 'new_administrateur/breadcrumbs',
|
|
|
|
|
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
|
|
|
|
'Archives'] }
|
|
|
|
|
|
|
|
|
|
.container
|
2021-05-26 18:32:34 +02:00
|
|
|
|
%h1.mb-2 Archives
|
2021-04-29 17:29:47 +02:00
|
|
|
|
|
|
|
|
|
.card.featured
|
|
|
|
|
.card-title Gestion de vos archives
|
|
|
|
|
%p
|
|
|
|
|
Vous pouvez télécharger les archives des dossiers terminés depuis la publication de la procédure au format Zip.
|
|
|
|
|
|
|
|
|
|
%p
|
|
|
|
|
Cet export contient les demande déposée par l'usager et la liste des pièces justificatives transmises.
|
|
|
|
|
|
|
|
|
|
%p
|
2021-05-26 15:16:30 +02:00
|
|
|
|
Cet export n’est pas possible pour le moment pour les démarches à forte volumétrie.
|
2021-04-29 17:29:47 +02:00
|
|
|
|
Nous vous invitons à regarder
|
|
|
|
|
= link_to 'la documentation', ARCHIVAGE_DOC_URL
|
2021-05-26 15:16:30 +02:00
|
|
|
|
afin de voir les options à votre disposition pour mettre en place un système d’archive.
|
2021-04-29 17:29:47 +02:00
|
|
|
|
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%table.table.hoverable.archive-table
|
2021-04-29 17:29:47 +02:00
|
|
|
|
%thead
|
|
|
|
|
%tr
|
|
|
|
|
%th
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%th.text-right Nombre de dossiers terminés
|
|
|
|
|
%th.text-right Poids estimé
|
|
|
|
|
%th.center Télécharger
|
2021-04-29 17:29:47 +02:00
|
|
|
|
|
|
|
|
|
%tbody
|
|
|
|
|
%tr
|
2021-05-26 15:41:45 +02:00
|
|
|
|
- matching_archive = @archives.find { |archive| archive.time_span_type == 'everything' }
|
2021-06-01 09:42:07 +02:00
|
|
|
|
- weight = estimate_weight(matching_archive, @nb_dossiers_termines, @average_dossier_weight)
|
2021-04-29 17:29:47 +02:00
|
|
|
|
%td
|
|
|
|
|
Tous les dossiers
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%td.text-right
|
2021-06-01 09:42:07 +02:00
|
|
|
|
= @nb_dossiers_termines
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%td.text-right
|
2021-04-29 17:29:47 +02:00
|
|
|
|
= number_to_human_size(weight)
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%td.center
|
2021-04-29 17:29:47 +02:00
|
|
|
|
- if matching_archive.try(&:available?)
|
|
|
|
|
= link_to url_for(matching_archive.file), class: 'button primary' do
|
|
|
|
|
%span.icon.download-white
|
|
|
|
|
= t(:archive_ready_html, generated_period: time_ago_in_words(matching_archive.updated_at), scope: [:instructeurs, :procedure])
|
|
|
|
|
- elsif matching_archive.try(&:pending?)
|
|
|
|
|
%span.icon.retry
|
|
|
|
|
= t(:archive_pending_html, created_period: time_ago_in_words(matching_archive.created_at), scope: [:instructeurs, :procedure])
|
2021-06-01 09:42:07 +02:00
|
|
|
|
- elsif @nb_dossiers_termines == 0
|
2021-05-26 17:49:24 +02:00
|
|
|
|
Rien à télécharger !
|
|
|
|
|
- elsif weight < 1.gigabyte
|
2021-04-29 17:29:47 +02:00
|
|
|
|
= link_to instructeur_archives_path(@procedure, type: 'everything'), method: :post, class: "button" do
|
|
|
|
|
%span.icon.new-folder
|
|
|
|
|
Demander la création
|
|
|
|
|
- else
|
2021-05-26 17:49:24 +02:00
|
|
|
|
Archive trop volumineuse
|
2021-05-26 15:41:45 +02:00
|
|
|
|
- @count_dossiers_termines_by_month.each do |count_by_month|
|
|
|
|
|
- month = count_by_month["month"].to_date
|
|
|
|
|
- nb_dossiers_termines = count_by_month["count"]
|
|
|
|
|
- matching_archive = @archives.find { |archive| archive.time_span_type == 'monthly' && archive.month == month }
|
2021-06-01 09:42:07 +02:00
|
|
|
|
- weight = estimate_weight(matching_archive, nb_dossiers_termines, @average_dossier_weight)
|
2021-05-26 17:28:57 +02:00
|
|
|
|
|
2021-04-29 17:29:47 +02:00
|
|
|
|
%tr
|
|
|
|
|
%td
|
2021-05-26 17:52:16 +02:00
|
|
|
|
= I18n.l(month, format: "%B %Y").capitalize
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%td.text-right
|
2021-04-29 17:29:47 +02:00
|
|
|
|
= nb_dossiers_termines
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%td.text-right
|
2021-04-29 17:29:47 +02:00
|
|
|
|
= number_to_human_size(weight)
|
2021-05-26 17:49:37 +02:00
|
|
|
|
%td.center
|
2021-05-26 16:30:07 +02:00
|
|
|
|
- if matching_archive.present?
|
|
|
|
|
- if matching_archive.status == 'generated' && matching_archive.file.attached?
|
|
|
|
|
= link_to url_for(matching_archive.file), class: 'button primary' do
|
|
|
|
|
%span.icon.download-white
|
|
|
|
|
= t(:archive_ready_html, generated_period: time_ago_in_words(matching_archive.updated_at), scope: [:instructeurs, :procedure])
|
2021-04-29 17:29:47 +02:00
|
|
|
|
- else
|
2021-05-26 16:30:07 +02:00
|
|
|
|
%span.icon.retry
|
|
|
|
|
= t(:archive_pending_html, created_period: time_ago_in_words(matching_archive.created_at), scope: [:instructeurs, :procedure])
|
2021-05-26 17:28:57 +02:00
|
|
|
|
- elsif weight < 1.gigabyte
|
2021-05-26 16:30:07 +02:00
|
|
|
|
= link_to instructeur_archives_path(@procedure, type:'monthly', month: month.strftime('%Y-%m')), method: :post, class: "button" do
|
|
|
|
|
%span.icon.new-folder
|
|
|
|
|
Démander la création
|
2021-05-26 17:28:57 +02:00
|
|
|
|
- else
|
|
|
|
|
Archive trop volumineuse
|
2021-04-29 17:29:47 +02:00
|
|
|
|
|