Add annuaire_education champ ui

This commit is contained in:
Paul Chavard 2021-01-14 17:30:55 +01:00
parent 54f2084aef
commit 91be115c70
7 changed files with 98 additions and 2 deletions

View file

@ -0,0 +1,54 @@
- if champ.data.blank?
= champ.to_s
- else
%table.table.vertical.dossier-champs
%tbody
%tr
%th.libelle Nom de létablissement :
%td= champ.data['nom_etablissement']
%tr
%th.libelle Lidentifiant de letablissement :
%td= champ.data['identifiant_de_l_etablissement']
%tr
%th.libelle SIREN/SIRET :
%td= champ.data['siren_siret']
%tr
%th.libelle Commune :
%td= "#{champ.data['nom_commune']} (#{champ.data['code_commune']})"
%tr
%th.libelle Academie :
%td= "#{champ.data['libelle_academie']} (#{champ.data['code_academie']})"
%tr
%th.libelle Nature de létablissement :
%td= "#{champ.data['libelle_nature']} (#{champ.data['code_nature']})"
- if champ.data['type_contrat_prive'] != 'SANS OBJET'
%tr
%th.libelle Type de contrat privé :
%td= champ.data['type_contrat_prive']
%tr
%th.libelle Nombre délèves :
%td= champ.data['nombre_d_eleves']
%tr
%th.libelle Adresse :
%td
= champ.data['adresse_1']
%br
= "#{champ.data['code_postal']} #{champ.data['nom_commune']}"
%br
= "#{champ.data['libelle_region']} (#{champ.data['code_region']})"
- if champ.data['telephone'].present?
%tr
%th.libelle Téléphone :
%td= champ.data['telephone']
- if champ.data['mail'].present?
%tr
%th.libelle Email :
%td= champ.data['mail']
- if champ.data['web'].present?
%tr
%th.libelle Site internet :
%td= champ.data['web']

View file

@ -34,6 +34,8 @@
= render partial: "shared/champs/iban/show", locals: { champ: c }
- when TypeDeChamp.type_champs.fetch(:textarea)
= render partial: "shared/champs/textarea/show", locals: { champ: c }
- when TypeDeChamp.type_champs.fetch(:annuaire_education)
= render partial: "shared/champs/annuaire_education/show", locals: { champ: c }
- when TypeDeChamp.type_champs.fetch(:date)
= c.to_s
- when TypeDeChamp.type_champs.fetch(:datetime)

View file

@ -0,0 +1,3 @@
- hidden_field_id = SecureRandom.uuid
= form.hidden_field :value, { data: { uuid: hidden_field_id } }
= react_component("ComboAnnuaireEducationSearch", mandatory: champ.mandatory?, hiddenFieldId: hidden_field_id )