feat(rnf): display rnf data in show
This commit is contained in:
parent
694cbcd0a2
commit
bfb8611c81
3 changed files with 66 additions and 0 deletions
24
app/views/shared/champs/rnf/_show.html.haml
Normal file
24
app/views/shared/champs/rnf/_show.html.haml
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue