affiche quand l'archive a été générée

This commit is contained in:
Christophe Robillard 2021-04-19 15:59:48 +02:00
parent fa4f6190c4
commit 59a08ad307
2 changed files with 7 additions and 5 deletions

View file

@ -47,10 +47,10 @@
- if matching_archive.try(&:available?) - if matching_archive.try(&:available?)
= link_to url_for(matching_archive.file), class: 'button primary' do = link_to url_for(matching_archive.file), class: 'button primary' do
%span.icon.download-white %span.icon.download-white
Télécharger = t(:archive_ready_html, generated_period: time_ago_in_words(matching_archive.updated_at), scope: [:instructeurs, :procedure])
- elsif matching_archive.try(&:pending?) - elsif matching_archive.try(&:pending?)
%span.icon.retry %span.icon.retry
Archive en cours de création = t(:archive_pending_html, created_period: time_ago_in_words(matching_archive.created_at), scope: [:instructeurs, :procedure])
- elsif @dossiers_termines.count > 0 - elsif @dossiers_termines.count > 0
= link_to instructeur_archives_path(@procedure, type: 'everything'), method: :post, class: "button", remote: true do = link_to instructeur_archives_path(@procedure, type: 'everything'), method: :post, class: "button", remote: true do
%span.icon.new-folder %span.icon.new-folder
@ -78,12 +78,12 @@
- if matching_archive.status == 'generated' && matching_archive.file.attached? - if matching_archive.status == 'generated' && matching_archive.file.attached?
= link_to url_for(matching_archive.file), class: 'button primary' do = link_to url_for(matching_archive.file), class: 'button primary' do
%span.icon.download-white %span.icon.download-white
Télécharger = t(:archive_ready_html, generated_period: time_ago_in_words(matching_archive.updated_at), scope: [:instructeurs, :procedure])
- else - else
%span.icon.retry %span.icon.retry
Archive en cours de création = t(:archive_pending_html, created_period: time_ago_in_words(matching_archive.created_at), scope: [:instructeurs, :procedure])
- else - else
= link_to instructeur_archives_path(@procedure, type:'monthly', month: month.strftime('%Y-%m')), method: :post, class: "button", remote: true do = link_to instructeur_archives_path(@procedure, type:'monthly', month: month.strftime('%Y-%m')), method: :post, class: "button" do
%span.icon.new-folder %span.icon.new-folder
Démander la création Démander la création
- else - else

View file

@ -9,3 +9,5 @@ fr:
export_ready_html: Télécharger lexport au format %{export_format}<br>(généré il y a %{export_time}) export_ready_html: Télécharger lexport au format %{export_format}<br>(généré il y a %{export_time})
export_pending_html: Un export au format %{export_format} est en train dêtre généré<br>(demandé il y a %{export_time}) export_pending_html: Un export au format %{export_format} est en train dêtre généré<br>(demandé il y a %{export_time})
download_archive: Télécharger une archive au format .zip de tous les dossiers et leurs pièces jointes download_archive: Télécharger une archive au format .zip de tous les dossiers et leurs pièces jointes
archive_pending_html: Archive en cours de création<br>(demandée il y a %{created_period})
archive_ready_html: Télécharger l'archive<br>(demandée il y a %{generated_period})