Merge pull request #3395 from tchak/style-repetition-remove-button

Move remove row button to the right and show button on previews
This commit is contained in:
Pierre de La Morinerie 2019-02-07 13:16:24 +01:00 committed by GitHub
commit 2a6a03423f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -32,6 +32,10 @@
&.column {
flex-direction: column;
}
&.row-reverse {
flex-direction: row-reverse;
}
}
.flex-grow {

View file

@ -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} »"