forked from demarches-simplifiees/demarches-simplifiees.fr
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request demarches-simplifiees#9101 from tchak/feat-accredi…
…atation-jo ETQ administrateur, je voudrais pouvoir utiliser le numéro d'accréditation Paris 2024
- Loading branch information
Showing
42 changed files
with
801 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
app/components/dossiers/champs_rows_show_component/champs_rows_show_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
- each_champ do |champ| | ||
- if champ.repetition? | ||
- champ.rows.each.with_index do |row, i| | ||
.fr-background-alt--grey.fr-p-2w.fr-my-3w.fr-ml-2w.champ-repetition | ||
%p.font-weight-bold= "#{champ.libelle} #{i + 1} :" | ||
|
||
= render Dossiers::ChampsRowsShowComponent.new(champs: row, seen_at:, profile:) | ||
|
||
- else | ||
= render Dossiers::RowShowComponent.new(label: champ.libelle, seen_at:, profile:, content_class: champ.type_champ, updated_at: updated_after_deposer?(champ) ? champ.updated_at : nil) do |c| | ||
- if champ.blank? | ||
- c.blank do | ||
= t(blank_key(champ)) | ||
- else | ||
- c.with_value do | ||
- case champ.type_champ | ||
- when TypeDeChamp.type_champs.fetch(:carte) | ||
= render partial: "shared/champs/carte/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:dossier_link) | ||
= render partial: "shared/champs/dossier_link/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:multiple_drop_down_list) | ||
= render partial: "shared/champs/multiple_drop_down_list/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:piece_justificative), TypeDeChamp.type_champs.fetch(:titre_identite) | ||
= render partial: "shared/champs/piece_justificative/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:siret) | ||
= render partial: "shared/champs/siret/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:iban) | ||
= render partial: "shared/champs/iban/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:textarea) | ||
= render partial: "shared/champs/textarea/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:annuaire_education) | ||
= render partial: "shared/champs/annuaire_education/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:cnaf) | ||
= render partial: "shared/champs/cnaf/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:dgfip) | ||
= render partial: "shared/champs/dgfip/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:pole_emploi) | ||
= render partial: "shared/champs/pole_emploi/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:mesri) | ||
= render partial: "shared/champs/mesri/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:address) | ||
= render partial: "shared/champs/address/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:communes) | ||
= render partial: "shared/champs/communes/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:regions) | ||
= render partial: "shared/champs/regions/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:rna) | ||
= render partial: "shared/champs/rna/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:epci) | ||
= render partial: "shared/champs/epci/show", locals: { champ: champ } | ||
- when TypeDeChamp.type_champs.fetch(:cojo) | ||
= render partial: "shared/champs/cojo/show", locals: { champ: champ, profile: @profile } | ||
- when TypeDeChamp.type_champs.fetch(:date) | ||
%p= champ.to_s | ||
- when TypeDeChamp.type_champs.fetch(:datetime) | ||
%p= champ.to_s | ||
- when TypeDeChamp.type_champs.fetch(:number), TypeDeChamp.type_champs.fetch(:integer_number), TypeDeChamp.type_champs.fetch(:decimal_number) | ||
%p= helpers.number_with_html_delimiter(champ.to_s) | ||
- else | ||
= helpers.format_text_value(champ.to_s.strip) # format already wrap in p | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
7 changes: 7 additions & 0 deletions
7
app/components/editable_champ/cojo_component/cojo_component.en.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
7 changes: 7 additions & 0 deletions
7
app/components/editable_champ/cojo_component/cojo_component.fr.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
23 changes: 23 additions & 0 deletions
23
app/components/editable_champ/cojo_component/cojo_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.