72 lines
3 KiB
Text
72 lines
3 KiB
Text
%table.table.vertical.dossier-champs
|
||
%tbody
|
||
- champs.reject(&:exclude_from_view?).each do |c|
|
||
%tr
|
||
- case c.type_champ
|
||
- when TypeDeChamp.type_champs.fetch(:header_section)
|
||
%th.header-section{ colspan: 3 }
|
||
= c.libelle
|
||
- when TypeDeChamp.type_champs.fetch(:multiple_drop_down_list)
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
- if c.to_s.present?
|
||
%ul
|
||
- c.to_s.split(", ").each do |item|
|
||
%li
|
||
= item
|
||
- when TypeDeChamp.type_champs.fetch(:dossier_link)
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
- dossier = Dossier.includes(:procedure).find_by(id: c.to_s)
|
||
- if dossier
|
||
- path = dossier_linked_path(current_gestionnaire, dossier)
|
||
- if path.present?
|
||
= link_to("Dossier nº #{dossier.id}", path, target: '_blank')
|
||
- else
|
||
Dossier nº #{dossier.id}
|
||
%br
|
||
= sanitize(dossier.text_summary)
|
||
- else
|
||
Pas de dossier associé
|
||
- when TypeDeChamp.type_champs.fetch(:piece_justificative)
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
- pj = c.piece_justificative_file
|
||
- if pj.attached?
|
||
= render partial: "shared/champs/piece_justificative/pj_link", locals: { champ: c, user_can_upload: false }
|
||
- else
|
||
Pièce justificative non fournie
|
||
- when TypeDeChamp.type_champs.fetch(:textarea)
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||
= simple_format(c.to_s)
|
||
- when TypeDeChamp.type_champs.fetch(:siret)
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||
- if c.etablissement.present?
|
||
= render partial: "shared/dossiers/identite_entreprise", locals: { etablissement: c.etablissement, profile: profile }
|
||
- when TypeDeChamp.type_champs.fetch(:carte)
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||
- if c.to_s.present?
|
||
= render partial: "shared/champs/carte/show", locals: { champ: c }
|
||
- else
|
||
%th.libelle
|
||
= "#{c.libelle} :"
|
||
%td.rich-text
|
||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||
= sanitize(c.to_s)
|
||
- if c.type_champ != TypeDeChamp.type_champs.fetch(:header_section)
|
||
%td.updated-at
|
||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||
modifié le
|
||
= c.updated_at.strftime("%d/%m/%Y à %H:%M")
|