[Fix #1016] display notifications on PJ

This commit is contained in:
Mathieu Magnin 2017-12-07 16:11:08 +01:00
parent c6be745067
commit 5474ff8bb4
3 changed files with 19 additions and 9 deletions

View file

@ -26,4 +26,4 @@
- if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
.accompagnateur-title Pièces jointes
.card
= render partial: "new_gestionnaire/dossiers/pieces_jointes", locals: { dossier: @dossier }
= render partial: "new_gestionnaire/dossiers/pieces_jointes", locals: { dossier: @dossier, demande_seen_at: nil }

View file

@ -1,4 +1,4 @@
%table.table.vertical.pj
%table.table.vertical.pj.dossier-champs
%tbody
- if dossier.procedure.cerfa_flag?
%tr
@ -8,17 +8,22 @@
= link_to "Télécharger", @dossier.cerfa.last.content_url, class: "link", target: :blank
- else
Pièce non fournie
%td
- dossier.procedure.types_de_piece_justificative.each do |type_de_piece_justificative|
- pjs = dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).to_ary.dup
- pj = pjs.shift if pjs.present?
%tr
%th= "#{type_de_piece_justificative.libelle} :"
- pjs = dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).to_ary.dup
- if pjs.present?
- first_pj = pjs.pop
%td= display_pj_filename(first_pj)
%td= link_to "Télécharger", first_pj.content_url, class: "link", target: :blank
- if pj
%td
%span{ class: highlight_if_unseen_class(demande_seen_at, pj.updated_at) }
= display_pj_filename(pj)
·
= link_to "Télécharger", pj.content_url, class: "link", target: :blank
- if pjs.present?
%br
%span.button.dropdown
anciennes versions
.dropdown-content.fade-in-down
@ -28,6 +33,11 @@
= link_to pj.content_url, { target: :blank } do
%span.filename= display_pj_filename(pj)
%span
ajoutée le #{pj.created_at.localtime.strftime('%d/%m %H:%M')}
ajoutée le #{pj.created_at.localtime.strftime('%d/%m/%Y à %H:%M')}
- else
%td Pièce non fournie
%td.updated-at
- if pj
%span{ class: highlight_if_unseen_class(demande_seen_at, pj.updated_at) }
modifié le
= pj.updated_at.localtime.strftime("%d/%m/%Y à %H:%M")

View file

@ -25,4 +25,4 @@
- if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
.accompagnateur-title Pièces jointes
.card
= render partial: "pieces_jointes", locals: { dossier: @dossier }
= render partial: "pieces_jointes", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }