refactor(block): use block? instead of repetition?
This commit is contained in:
parent
79abca8945
commit
462cc41caa
13 changed files with 38 additions and 33 deletions
|
@ -20,12 +20,12 @@ class EditableChamp::EditableChampComponent < ApplicationComponent
|
|||
{
|
||||
class: "editable-champ-#{@champ.type_champ} #{'hidden' if !@champ.visible?}",
|
||||
id: @champ.input_group_id,
|
||||
data: { controller: stimulus_controller }
|
||||
data: { controller: stimulus_controller, block: @champ.block? }
|
||||
}
|
||||
end
|
||||
|
||||
def stimulus_controller
|
||||
if !@champ.repetition? && @champ.fillable?
|
||||
if !@champ.block? && @champ.fillable?
|
||||
# This is an editable champ. Lets find what controllers it might need.
|
||||
controllers = []
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.editable-champ{ html_options }
|
||||
- if @champ.repetition?
|
||||
- if @champ.block?
|
||||
%h3.header-subsection= @champ.libelle
|
||||
- if @champ.description.present?
|
||||
%p.notice= string_to_html(@champ.description, false)
|
||||
|
@ -9,5 +9,5 @@
|
|||
- if @champ.type_champ == "titre_identite"
|
||||
%p.notice Carte nationale d’identité (uniquement le recto), passeport, titre de séjour ou autre justificatif d’identité. Formats acceptés : jpg/png
|
||||
|
||||
= @form.hidden_field :id, value: @champ.id, data: @champ.repetition? ? { id: true } : {}
|
||||
= @form.hidden_field :id, value: @champ.id, data: @champ.block? ? { id: true } : {}
|
||||
= render component_class.new(form: @form, champ: @champ, seen_at: @seen_at)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue