From 004cdd4c43ebddefd5fb1dc170e3017962da6ac1 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Fri, 28 Dec 2018 16:08:38 +0100 Subject: [PATCH] Add highlights to all champs --- app/views/shared/dossiers/_champs.html.haml | 43 +++++++++++---------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/app/views/shared/dossiers/_champs.html.haml b/app/views/shared/dossiers/_champs.html.haml index bf762837b..f8688a4d6 100644 --- a/app/views/shared/dossiers/_champs.html.haml +++ b/app/views/shared/dossiers/_champs.html.haml @@ -10,35 +10,38 @@ %th.libelle = "#{c.libelle} :" %td.rich-text - - if c.to_s.present? - %ul - - c.to_s.split(", ").each do |item| - %li - = item + %span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) } + - 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') + %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 - Dossier nº #{dossier.id} - %br - = sanitize(dossier.text_summary) - - else - Pas de dossier associé + 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 + %span{ class: highlight_if_unseen_class(demande_seen_at, c.updated_at) } + - 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} :"