Extract the dossier_link champ view in a partial
This commit is contained in:
parent
004cdd4c43
commit
c7f2293c15
2 changed files with 12 additions and 11 deletions
11
app/views/shared/champs/dossier_link/_show.html.haml
Normal file
11
app/views/shared/champs/dossier_link/_show.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
|||
- dossier = Dossier.includes(:procedure).find_by(id: champ.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é
|
|
@ -21,17 +21,7 @@
|
|||
= "#{c.libelle} :"
|
||||
%td.rich-text
|
||||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||||
- 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é
|
||||
= render partial: "shared/champs/dossier_link/show", locals: { champ: c }
|
||||
- when TypeDeChamp.type_champs.fetch(:piece_justificative)
|
||||
%th.libelle
|
||||
= "#{c.libelle} :"
|
||||
|
|
Loading…
Reference in a new issue