[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? - if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
.accompagnateur-title Pièces jointes .accompagnateur-title Pièces jointes
.card .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 %tbody
- if dossier.procedure.cerfa_flag? - if dossier.procedure.cerfa_flag?
%tr %tr
@ -8,17 +8,22 @@
= link_to "Télécharger", @dossier.cerfa.last.content_url, class: "link", target: :blank = link_to "Télécharger", @dossier.cerfa.last.content_url, class: "link", target: :blank
- else - else
Pièce non fournie Pièce non fournie
%td
- dossier.procedure.types_de_piece_justificative.each do |type_de_piece_justificative| - 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 %tr
%th= "#{type_de_piece_justificative.libelle} :" %th= "#{type_de_piece_justificative.libelle} :"
- pjs = dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).to_ary.dup - if pj
- 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
%td %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? - if pjs.present?
%br
%span.button.dropdown %span.button.dropdown
anciennes versions anciennes versions
.dropdown-content.fade-in-down .dropdown-content.fade-in-down
@ -28,6 +33,11 @@
= link_to pj.content_url, { target: :blank } do = link_to pj.content_url, { target: :blank } do
%span.filename= display_pj_filename(pj) %span.filename= display_pj_filename(pj)
%span %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 - else
%td Pièce non fournie %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? - if @dossier.procedure.cerfa_flag? || @dossier.types_de_piece_justificative.any?
.accompagnateur-title Pièces jointes .accompagnateur-title Pièces jointes
.card .card
= render partial: "pieces_jointes", locals: { dossier: @dossier } = render partial: "pieces_jointes", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }