feat(exports): name the dossiers count

This commit is contained in:
Colin Darie 2023-09-20 12:22:43 +02:00
parent c7cd5d2189
commit ed057737a5
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
5 changed files with 26 additions and 14 deletions

View file

@ -31,9 +31,14 @@ class Dossiers::ExportLinkComponent < ApplicationComponent
end end
def export_title(export) def export_title(export)
t(".export_title", count = export.count
export_tabs: export.statut.to_s,
export_format: export.format) case count
when nil
t(".export_title", export_tabs: export.statut.to_s, export_format: export.format)
else
t(".export_title_counted", export_tabs: export.statut.to_s, export_format: export.format, count: count)
end
end end
def badge(export) def badge(export)

View file

@ -7,12 +7,15 @@ en:
everything_json_html: Request an export in .json format (GeoJSON) everything_json_html: Request an export in .json format (GeoJSON)
everything_short: Request an export in %{export_format} format everything_short: Request an export in %{export_format} format
refresh_old_export: Recreate this export refresh_old_export: Recreate this export
everything_ready: Download the export in %{export_format} format everything_ready: Download in %{export_format} format
success_label: Ready success_label: Ready
failed_label: Failed failed_label: Failed
pending_label: In progress pending_label: In progress
refresh_page: Refresh page refresh_page: Refresh page
export_title: Export .%{export_format} for files « %{export_tabs} » export_title: Export .%{export_format} for files « %{export_tabs} »
export_title_counted:
one: Export .%{export_format} of 1 file « %{export_tabs} »
other: Export .%{export_format} of %{count} files « %{export_tabs} »
ready_link_label_time_info: " - generated %{export_time} ago" ready_link_label_time_info: " - generated %{export_time} ago"
not_ready_link_label_time_info: " - asked %{export_time} ago" not_ready_link_label_time_info: " - asked %{export_time} ago"
download_all: Download all files download_all: Download all files

View file

@ -7,14 +7,17 @@ fr:
everything_json_html: Demander un export au format .json (GeoJSON) everything_json_html: Demander un export au format .json (GeoJSON)
everything_short: Demander un export au format %{export_format} everything_short: Demander un export au format %{export_format}
refresh_old_export: Recréer cet export refresh_old_export: Recréer cet export
everything_ready: Télécharger lexport au format %{export_format} everything_ready: Télécharger au format %{export_format}
success_label: Prêt success_label: Prêt
failed_label: Erreur failed_label: Erreur
pending_label: En cours pending_label: En préparation
refresh_page: Recharger la page refresh_page: Recharger la page
export_title: Export .%{export_format} pour les dossiers « %{export_tabs} » export_title: "Export .%{export_format} des dossiers « %{export_tabs} »"
ready_link_label_time_info: " - généré il y a %{export_time}" export_title_counted:
not_ready_link_label_time_info: " - demandé il y a %{export_time}" one: "Export .%{export_format} dun dossier « %{export_tabs} »"
other: "Export .%{export_format} de %{count} dossiers « %{export_tabs} »"
ready_link_label_time_info: " généré il y a %{export_time}"
not_ready_link_label_time_info: " demandé il y a %{export_time}"
download_all: Télécharger tous les dossiers download_all: Télécharger tous les dossiers
download: download:
one: Télécharger un dossier one: Télécharger un dossier

View file

@ -2,6 +2,7 @@
- @exports.each do |export| - @exports.each do |export|
%li.fr-mb-3w %li.fr-mb-3w
.flex .flex
%span
%strong %strong
= export_title(export) = export_title(export)
%span.fr-text-mention--grey.fr-mb-1w %span.fr-text-mention--grey.fr-mb-1w

View file

@ -114,7 +114,7 @@ class Export < ApplicationRecord
def count def count
if procedure_presentation_id.present? if procedure_presentation_id.present?
dossiers_for_export.size dossiers_for_export.count
end end
end end