Skip to content

Commit

Permalink
feat(rnf): display rnf data in show
Browse files Browse the repository at this point in the history
  • Loading branch information
E-L-T committed Oct 27, 2023
1 parent 0a5dea0 commit 8530126
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/views/shared/champs/rnf/_show.html.haml
Original file line number Diff line number Diff line change
@@ -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)
21 changes: 21 additions & 0 deletions config/locales/models/champs/rnf_champ/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
en:
activemodel:
attributes:
rnf_champ:
rnf_id: RNF id
data:
title: Fondation 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"
21 changes: 21 additions & 0 deletions config/locales/models/champs/rnf_champ/fr.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 8530126

Please sign in to comment.