demarches-normaliennes/app/views/shared/dossiers/editable_champs/_repetition.html.haml
2020-02-11 17:36:50 +01:00

23 lines
983 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

%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
.flex.row-reverse
- if champ.persisted?
%button.button.danger.remove-row{ type: :button }
Supprimer lélément
- else
%button.button.danger{ type: :button }
Supprimer lélément
- if champ.persisted?
= link_to champs_repetition_path(form.index), class: 'button add-row', data: { remote: true, method: 'POST', params: { champ_id: champ&.id }.to_query } do
%span.icon.add
Ajouter un élément pour « #{champ.libelle} »
- else
%a.button.add-row
%span.icon.add
Ajouter un élément pour « #{champ.libelle} »