From f7842fa4bdf3a8ffe6799da0a9df97af57c936c6 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Thu, 18 Jul 2019 09:36:19 +0200 Subject: [PATCH] ajout d'un message lorsque le dossier fait plus de 50Mo --- app/views/gestionnaires/dossiers/_header.html.haml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/gestionnaires/dossiers/_header.html.haml b/app/views/gestionnaires/dossiers/_header.html.haml index 61afc1361..1eda6a77a 100644 --- a/app/views/gestionnaires/dossiers/_header.html.haml +++ b/app/views/gestionnaires/dossiers/_header.html.haml @@ -18,13 +18,16 @@ = link_to "Tout le dossier", print_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" %li = link_to "Uniquement cet onglet", "#", onclick: "window.print()", class: "menu-item menu-link" - - if Flipflop.download_as_zip_enabled? && dossier.attachments_downloadable? + - if Flipflop.download_as_zip_enabled? && !PiecesJustificativesService.liste_pieces_justificatives(dossier).empty? %span.dropdown.print-menu-opener %button.button.dropdown-button.icon-only %span.icon.attachment %ul.print-menu.dropdown-content %li - = link_to "Télécharger toutes les pièces jointes", telecharger_pjs_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" + - if PiecesJustificativesService.pieces_justificatives_total_size(dossier) < 50.megabytes + = link_to "Télécharger toutes les pièces jointes", telecharger_pjs_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" + - else + %p.menu-item Le téléchargement des dossiers est désactivé pour les dossiers de plus de 50Mo. = render partial: "gestionnaires/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) }