From d5954c7423b74ed469eacde7ddd41c2ba749a7f7 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Tue, 21 Nov 2017 14:09:37 +0100 Subject: [PATCH] Show links to uploaded pieces justificatives in drafts --- app/views/users/description/_pieces_justificatives.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/users/description/_pieces_justificatives.html.haml b/app/views/users/description/_pieces_justificatives.html.haml index f69131005..dc07f9502 100644 --- a/app/views/users/description/_pieces_justificatives.html.haml +++ b/app/views/users/description/_pieces_justificatives.html.haml @@ -38,6 +38,9 @@ - if !dossier.was_piece_justificative_uploaded_for_type_id?(tpj.id) = file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes - else + - pj = dossier.retrieve_last_piece_justificative_by_type(tpj.id) + %a{ href: pj.content_url, target: '_blank' } + = pj.original_filename %span.btn.btn-sm.btn-file.btn-success Modifier = file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes