diff --git a/app/views/new_administrateur/procedures/_informations.html.haml b/app/views/new_administrateur/procedures/_informations.html.haml index 780a3ef4a..c473c2726 100644 --- a/app/views/new_administrateur/procedures/_informations.html.haml +++ b/app/views/new_administrateur/procedures/_informations.html.haml @@ -14,17 +14,11 @@ = f.text_area :description, rows: '6', placeholder: 'Description de la démarche, destinataires, etc. ', class: 'form-control' %h2.header-section Logo de la démarche -- if @procedure.persisted? - = link_to 'supprimer', delete_logo_admin_procedure_path(@procedure), method: :delete -.pj-input - = f.file_field :logo, - direct_upload: true, += render 'shared/attachment/edit', + { form: f, + attached_file: @procedure.logo, accept: 'image/png, image/jpg, image/jpeg', - style: 'display: inline' - -%div{ style: 'margin-top: 5px;' } - %i - Fichier accepté : JPG / JPEG / PNG + user_can_destroy: true } - if !@procedure.locked? %h2.header-section Conservation des données @@ -65,21 +59,10 @@ = f.text_field :cadre_juridique, class: 'form-control', placeholder: 'https://www.legifrance.gouv.fr/' = f.label :deliberation, 'Importer le texte' -- deliberation = @procedure.deliberation -- if !deliberation.attached? - .pj-input - = f.file_field :deliberation, - direct_upload: true -- else - %a{ href: url_for(deliberation), target: '_blank', rel: 'noopener' } - = deliberation.filename.to_s - - if @procedure.persisted? - = link_to 'supprimer', delete_deliberation_admin_procedure_path(@procedure), method: :delete - %br - Modifier : - .pj-input - = f.file_field :deliberation, - direct_upload: true += render 'shared/attachment/edit', + { form: f, + attached_file: @procedure.deliberation, + user_can_destroy: true } %h2.header-section Notice explicative de la démarche @@ -89,22 +72,10 @@ .notice %p Une notice explicative est un document destiné à guider l’usager dans sa démarche. C’est un document que vous avez élaboré et qui peut prendre la forme d’un fichier doc, d’un pdf ou encore de diapositives. Le bouton pour télécharger cette notice apparaît en haut du formulaire pour l’usager. - -- if !notice.attached? - .pj-input - = f.file_field :notice, - direct_upload: true -- else - %a{ href: url_for(notice), target: '_blank', rel: 'noopener' } - = notice.filename.to_s - - if @procedure.persisted? - \- - = link_to 'supprimer', delete_notice_admin_procedure_path(@procedure), method: :delete - %br - Modifier : - .pj-input - = f.file_field :notice, - direct_upload: true += render 'shared/attachment/edit', + { form: f, + attached_file: @procedure.notice, + user_can_destroy: true } - if !@procedure.locked? %h2.header-section À qui s’adresse ma démarche ?