diff --git a/app/assets/stylesheets/new_design/flex.scss b/app/assets/stylesheets/new_design/flex.scss index 317ebf55c..b16b0e243 100644 --- a/app/assets/stylesheets/new_design/flex.scss +++ b/app/assets/stylesheets/new_design/flex.scss @@ -32,6 +32,10 @@ &.column { flex-direction: column; } + + &.row-reverse { + flex-direction: row-reverse; + } } .flex-grow { diff --git a/app/views/shared/dossiers/editable_champs/_repetition.html.haml b/app/views/shared/dossiers/editable_champs/_repetition.html.haml index ff5f35644..7f25613da 100644 --- a/app/views/shared/dossiers/editable_champs/_repetition.html.haml +++ b/app/views/shared/dossiers/editable_champs/_repetition.html.haml @@ -5,9 +5,16 @@ = form.fields_for :champs, champ do |form| = render partial: 'shared/dossiers/editable_champs/editable_champ', locals: { champ: form.object, form: form } = form.hidden_field :_destroy, disabled: true - - if champ.persisted? - %button.button.danger.remove-row - Supprimer + .flex.row-reverse + - if champ.persisted? + %button.button.danger.remove-row + Supprimer + - else + %button.button.danger{ type: :button } + Supprimer - if champ.persisted? = link_to "Ajouter une ligne pour « #{champ.libelle} »", champs_repetition_path(form.index), class: 'button add-row', data: { remote: true, method: 'POST', params: { champ_id: champ&.id }.to_query } +- else + %button.button{ type: :button } + = "Ajouter une ligne pour « #{champ.libelle} »"