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} :"
|
= "#{c.libelle} :"
|
||||||
%td.rich-text
|
%td.rich-text
|
||||||
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
|
||||||
- dossier = Dossier.includes(:procedure).find_by(id: c.to_s)
|
= render partial: "shared/champs/dossier_link/show", locals: { champ: c }
|
||||||
- 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)
|
- when TypeDeChamp.type_champs.fetch(:piece_justificative)
|
||||||
%th.libelle
|
%th.libelle
|
||||||
= "#{c.libelle} :"
|
= "#{c.libelle} :"
|
||||||
|
|
Loading…
Add table
Reference in a new issue