feat(rnf): display rnf data in show

This commit is contained in:
Eric Leroy-Terquem 2023-10-27 14:21:31 +02:00
parent 694cbcd0a2
commit bfb8611c81
3 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,24 @@
- if champ.data.blank?
%p= t('.not_found', rnf: champ.rnf_id)
- else
.fr-background-alt--grey.fr-p-3v
= render Dossiers::RowShowComponent.new(label: t("activemodel.attributes.rnf_champ.rnf_id")) do |c|
- c.with_value do
%p
= champ.rnf_id
= render Dsfr::CopyButtonComponent.new(text: champ.rnf_id, title: t("activemodel.attributes.rnf_champ.paste"), success: t("activemodel.attributes.rnf_champ.paste_success"))
- ['title', 'email', 'phone', 'address', 'status'].each do |scope|
- if champ.data[scope].present?
= render Dossiers::RowShowComponent.new(label: t("activemodel.attributes.rnf_champ.data.#{scope}")) do |c|
- if scope == 'address'
- c.with_value do
%p= champ.data[scope]['label']
- else
- c.with_value do
%p= champ.data[scope]
- ['createdAt', 'updatedAt', 'dissolvedAt'].each do |scope|
- if champ.data[scope].present?
= render Dossiers::RowShowComponent.new(label: t("activemodel.attributes.rnf_champ.data.#{scope}")) do |c|
- c.with_value do
%p= l(champ.data[scope].to_date)

View file

@ -0,0 +1,21 @@
en:
activemodel:
attributes:
rnf_champ:
rnf_id: RNF id
data:
title: Foundation name
email: Email
phone: Phone
createdAt: Created at
updatedAt: Updated at
dissolvedAt: Dissolved at
address: Address
status: Status
paste: Copy the RNF to the clipboard
paste_success: The RNF has been copied to the clipboard
activerecord:
attributes:
champs/rnf_champ:
hints:
value: "Expected format : 075-FDD-00003-01"

View file

@ -0,0 +1,21 @@
fr:
activemodel:
attributes:
rnf_champ:
rnf_id: Numéro RNF
data:
title: Nom de la fondation
email: Email
phone: Téléphone
createdAt: Créée le
updatedAt: Mise à jour le
dissolvedAt: Dissoute le
address: Adresse
status: Statut
paste: Copier le RNF dans le presse-papier
paste_success: Le RNF a été copié dans le presse-papier
activerecord:
attributes:
champs/rnf_champ:
hints:
value: "Format attendu : 075-FDD-00003-01"