dossiers: save draft by default (instead of submitting)

Make the default behavior of `update_brouillon` be to update the draft,
instead of submitting the dossier.

This makes all requests made to `update_brouillon` without specifying
an extra `submit_draft` parameter to just save the draft. It will make
autosaving the draft easier and safer.
This commit is contained in:
Pierre de La Morinerie 2019-11-06 15:54:14 +00:00
parent 03a7bc3d5a
commit 8b8a96abda
3 changed files with 16 additions and 15 deletions

View file

@ -43,13 +43,14 @@
- if dossier.brouillon?
= f.button 'Enregistrer le brouillon',
formnovalidate: true,
name: :save_draft,
value: true,
class: 'button send secondary',
data: { 'disable-with': "Envoi en cours…" }
- if dossier.can_transition_to_en_construction?
= f.button 'Déposer le dossier',
name: :submit_draft,
value: true,
class: 'button send primary',
disabled: !current_user.owns?(dossier),
data: { 'disable-with': "Envoi en cours…" }