From 03a7bc3d5adc5322b73bafc92b61000d8cd185ef Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 6 Nov 2019 14:03:08 +0000 Subject: [PATCH] dossiers: give the edit form an unique id --- app/views/shared/dossiers/_edit.html.haml | 8 ++++---- app/views/users/dossiers/brouillon.html.haml | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/shared/dossiers/_edit.html.haml b/app/views/shared/dossiers/_edit.html.haml index c617a2450..318489100 100644 --- a/app/views/shared/dossiers/_edit.html.haml +++ b/app/views/shared/dossiers/_edit.html.haml @@ -2,13 +2,13 @@ = render partial: "shared/dossiers/submit_is_over", locals: { dossier: dossier } - if apercu - - form_options = { url: '', method: :get, html: { class: 'form', multipart: true } } + - form_options = { url: '', method: :get } - elsif dossier.brouillon? - - form_options = { url: brouillon_dossier_url(dossier), method: :patch, html: { class: 'form', multipart: true } } + - form_options = { url: brouillon_dossier_url(dossier), method: :patch } - else - - form_options = { url: modifier_dossier_url(dossier), method: :patch, html: { class: 'form', multipart: true } } + - form_options = { url: modifier_dossier_url(dossier), method: :patch } - = form_for dossier, form_options do |f| + = form_for dossier, form_options.merge({ html: { id: 'dossier-edit-form', class: 'form', multipart: true } }) do |f| .prologue %p.mandatory-explanation diff --git a/app/views/users/dossiers/brouillon.html.haml b/app/views/users/dossiers/brouillon.html.haml index 766708cef..580ecd2d7 100644 --- a/app/views/users/dossiers/brouillon.html.haml +++ b/app/views/users/dossiers/brouillon.html.haml @@ -3,8 +3,9 @@ - content_for :footer do = render partial: "users/procedure_footer", locals: { procedure: @dossier.procedure, dossier: @dossier } -.dossier-header.sub-header - .container - = render partial: "shared/dossiers/header", locals: { dossier: @dossier, apercu: false } +#dossier-draft + .dossier-header.sub-header + .container + = render partial: "shared/dossiers/header", locals: { dossier: @dossier, apercu: false } -= render partial: "shared/dossiers/edit", locals: { dossier: @dossier, apercu: false } + = render partial: "shared/dossiers/edit", locals: { dossier: @dossier, apercu: false }