2019-01-30 16:14:15 +01:00
|
|
|
%div{ class: "repetition-#{form.index}" }
|
|
|
|
- champ.rows.each do |champs|
|
|
|
|
%div{ class: "row row-#{champs.first.row}" }
|
|
|
|
- champs.each do |champ|
|
|
|
|
= 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
|
2019-02-07 13:10:29 +01:00
|
|
|
.flex.row-reverse
|
|
|
|
- if champ.persisted?
|
2019-06-04 17:59:02 +02:00
|
|
|
%button.button.danger.remove-row{ type: :button }
|
2019-02-07 13:10:29 +01:00
|
|
|
Supprimer
|
|
|
|
- else
|
|
|
|
%button.button.danger{ type: :button }
|
|
|
|
Supprimer
|
2019-01-30 16:14:15 +01:00
|
|
|
|
|
|
|
- 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 }
|
2019-02-07 13:10:29 +01:00
|
|
|
- else
|
|
|
|
%button.button{ type: :button }
|
|
|
|
= "Ajouter une ligne pour « #{champ.libelle} »"
|