demarches-normaliennes/app/views/new_gestionnaire/dossiers/_champs.html.haml

54 lines
1.9 KiB
Text
Raw Normal View History

%table.table.vertical.dossier-champs
2017-07-11 16:50:29 +02:00
%tbody
- champs.reject { |c| c.type_champ == "explication" }.each do |c|
2017-07-11 16:50:29 +02:00
%tr
- case c.type_champ
- when "header_section"
%th.header-section{ colspan: 3 }
2017-07-11 16:50:29 +02:00
= c.libelle
- when "multiple_drop_down_list"
%th.libelle
= "#{c.libelle} :"
%td.rich-text
- if c.value.present?
%ul
- c.value.split(", ").each do |item|
%li
= item
- when "dossier_link"
%th.libelle
= "#{c.libelle} :"
%td.rich-text
- dossier = Dossier.includes(:procedure).find_by(id: c.value)
- 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 "piece_justificative"
%th.libelle
= "#{c.libelle} :"
%td.rich-text
- pj = c.piece_justificative_file
- if pj.attached?
%a{ href: url_for(pj), target: '_blank' }
= pj.filename.to_s
- else
Pièce justificative non fournie
- else
%th.libelle
2017-07-11 16:50:29 +02:00
= "#{c.libelle} :"
%td.rich-text
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
= sanitize(c.value)
- if c.type_champ != "header_section"
%td.updated-at
%span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) }
modifié le
= c.updated_at.localtime.strftime("%d/%m/%Y à %H:%M")