feat(exports): name the dossiers count
This commit is contained in:
parent
c7cd5d2189
commit
ed057737a5
5 changed files with 26 additions and 14 deletions
|
@ -31,9 +31,14 @@ class Dossiers::ExportLinkComponent < ApplicationComponent
|
|||
end
|
||||
|
||||
def export_title(export)
|
||||
t(".export_title",
|
||||
export_tabs: export.statut.to_s,
|
||||
export_format: export.format)
|
||||
count = export.count
|
||||
|
||||
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
|
||||
|
||||
def badge(export)
|
||||
|
|
|
@ -7,12 +7,15 @@ en:
|
|||
everything_json_html: Request an export in .json format (GeoJSON)
|
||||
everything_short: Request an export in %{export_format} format
|
||||
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
|
||||
failed_label: Failed
|
||||
pending_label: In progress
|
||||
refresh_page: Refresh page
|
||||
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"
|
||||
not_ready_link_label_time_info: " - asked %{export_time} ago"
|
||||
download_all: Download all files
|
||||
|
|
|
@ -7,14 +7,17 @@ fr:
|
|||
everything_json_html: Demander un export au format .json (GeoJSON)
|
||||
everything_short: Demander un export au format %{export_format}
|
||||
refresh_old_export: Recréer cet export
|
||||
everything_ready: Télécharger l’export au format %{export_format}
|
||||
everything_ready: Télécharger au format %{export_format}
|
||||
success_label: Prêt
|
||||
failed_label: Erreur
|
||||
pending_label: En cours
|
||||
pending_label: En préparation
|
||||
refresh_page: Recharger la page
|
||||
export_title: Export .%{export_format} pour les 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}"
|
||||
export_title: "Export .%{export_format} des dossiers « %{export_tabs} »"
|
||||
export_title_counted:
|
||||
one: "Export .%{export_format} d’un 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:
|
||||
one: Télécharger un dossier
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
- @exports.each do |export|
|
||||
%li.fr-mb-3w
|
||||
.flex
|
||||
%span
|
||||
%strong
|
||||
= export_title(export)
|
||||
%span.fr-text-mention--grey.fr-mb-1w
|
||||
|
|
|
@ -114,7 +114,7 @@ class Export < ApplicationRecord
|
|||
|
||||
def count
|
||||
if procedure_presentation_id.present?
|
||||
dossiers_for_export.size
|
||||
dossiers_for_export.count
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue