feat(cojo): add cojo type de champ
This commit is contained in:
parent
c74351459e
commit
d5820277c0
31 changed files with 361 additions and 12 deletions
9
app/components/editable_champ/cojo_component.rb
Normal file
9
app/components/editable_champ/cojo_component.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class EditableChamp::COJOComponent < EditableChamp::EditableChampBaseComponent
|
||||
def input_group_class
|
||||
if @champ.accreditation_success?
|
||||
'fr-input-group--valid'
|
||||
elsif @champ.accreditation_error?
|
||||
'fr-input-group--error'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
en:
|
||||
accreditation_number_label: Accreditation number
|
||||
accreditation_number_notice: Identification number issued by Paris 2024
|
||||
accreditation_birthdate_label: Date of birth
|
||||
accreditation_number_error: Invalid accreditation number
|
||||
accreditation_number_verification_pending: Accreditation number verification in progress
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
fr:
|
||||
accreditation_number_label: Numéro d‘accréditation
|
||||
accreditation_number_notice: Numéro d‘identification délivré par Paris 2024
|
||||
accreditation_birthdate_label: Date de naissance
|
||||
accreditation_number_error: Le numéro d‘accréditation est incorrect
|
||||
accreditation_number_verification_pending: Vérification du numéro d‘accréditation en cours
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
.fr-input-group{ class: input_group_class }
|
||||
= @form.label :accreditation_number, for: @champ.accreditation_number_input_id, class: 'fr-label' do
|
||||
- safe_join [t('.accreditation_number_label'), @champ.required? ? render(EditableChamp::AsteriskMandatoryComponent.new) : ''], ' '
|
||||
%p.fr-hint-text{ id: dom_id(@champ, :accreditation_number_notice) }= t('.accreditation_number_notice')
|
||||
= @form.text_field :accreditation_number,
|
||||
required: @champ.required?,
|
||||
aria: { describedby: [dom_id(@champ, :accreditation_number_notice), @champ.accreditation_error? ? dom_id(@champ, :accreditation_number_error) : nil].compact.join(' ') },
|
||||
data: { controller: 'format', format: 'integer' },
|
||||
class: "width-33-desktop fr-input small-margin", id: @champ.accreditation_number_input_id
|
||||
|
||||
- if @champ.accreditation_error?
|
||||
%p.fr-error-text{ id: dom_id(@champ, :accreditation_number_error) }= t('.accreditation_number_error')
|
||||
- elsif @champ.fetch_external_data_pending?
|
||||
%p.fr-info-text= t('.accreditation_number_verification_pending')
|
||||
|
||||
.fr-input-group{ class: input_group_class }
|
||||
= @form.label :accreditation_birthdate, for: @champ.accreditation_birthdate_input_id, class: 'fr-label' do
|
||||
- safe_join [t('.accreditation_birthdate_label'), @champ.required? ? render(EditableChamp::AsteriskMandatoryComponent.new) : ''], ' '
|
||||
= @form.date_field :accreditation_birthdate,
|
||||
required: @champ.required?,
|
||||
aria: { describedby: dom_id(@champ, :accreditation_birthdate) },
|
||||
class: "width-33-desktop fr-input small-margin", id: @champ.accreditation_birthdate_input_id
|
Loading…
Add table
Add a link
Reference in a new issue