From 1b26b01bbfddb24f9b7c9abc643709a3d41b5612 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 4 Dec 2020 12:28:24 +0100 Subject: [PATCH 1/2] alpes-maritimes-2018: add seniors cells (#49120) --- static/alpes-maritimes-2018/config.json | 79 +++++++++ .../combo/json/seniors-affectation-agent.html | 16 ++ .../json/seniors-page-senior-contenu.html | 152 ++++++++++++++++++ .../json/seniors-page-senior-sidebar.html | 44 +++++ 4 files changed, 291 insertions(+) create mode 100644 templates/variants/alpes-maritimes-2018/combo/json/seniors-affectation-agent.html create mode 100644 templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-contenu.html create mode 100644 templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-sidebar.html diff --git a/static/alpes-maritimes-2018/config.json b/static/alpes-maritimes-2018/config.json index 0c7568d5..ecaeb81e 100644 --- a/static/alpes-maritimes-2018/config.json +++ b/static/alpes-maritimes-2018/config.json @@ -219,6 +219,85 @@ } ], "url": "{{ passerelle_url }}astregs/{{ slug }}/links?NameID={{ user_nameid }}" + }, + "seniors-page-senior-contenu": { + "name": "Seniors - Page du senior - Contenu", + "url": "{{ idp_url }}api/users/{{ name_id }}", + "varnames": [], + "log_errors": false, + "cache_duration": 0, + "force_async": true, + "additional-data": [ + { + "key": "liste_fiches", + "url": "{{ eservices_url }}api/cards/senior/list?NameID={{ user_nameid }}&filter-user-uuid={{ name_id }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + }, + { + "key": "fiche", + "url": "{{ eservices_url }}api/cards/senior/{{ liste_fiches.data.0.id }}/?NameID={{ user_nameid }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + }, + { + "key": "conjoint", + "url": "{{ eservices_url }}api/cards/senior/{{ fiche.fields.conjoint_senior_raw }}/?NameID={{ user_nameid }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + } + ] + }, + "seniors-page-senior-sidebar": { + "name": "Seniors - Page du senior - Barre latérale", + "url": "{{ idp_url }}api/users/{{ name_id }}", + "varnames": [], + "log_errors": false, + "cache_duration": 0, + "force_async": true, + "additional-data": [ + { + "key": "liste_fiches", + "url": "{{ eservices_url }}api/cards/senior/list?NameID={{ user_nameid }}&filter-user-uuid={{ name_id }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + }, + { + "key": "fiche", + "url": "{{ eservices_url }}api/cards/senior/{{ liste_fiches.data.0.id }}/?NameID={{ user_nameid }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + } + ] + }, + "seniors-affectation-agent": { + "name": "Seniors - Affectation de l'agent", + "url": "{{ idp_url }}api/users/{{ user_nameid }}", + "varnames": [], + "log_errors": false, + "cache_duration": 0, + "force_async": true, + "additional-data": [ + { + "key": "liste_fiches", + "url": "{{ eservices_url }}api/cards/seniors-fiche-agent/list?NameID={{ user_nameid }}&filter-user-uuid={{ user_nameid }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + }, + { + "key": "fiche", + "url": "{{ eservices_url }}api/cards/seniors-fiche-agent/{{ liste_fiches.data.0.id }}/?NameID={{ user_nameid }}", + "cache_duration": 0, + "log_errors": false, + "timeout": 5 + } + ] } } } diff --git a/templates/variants/alpes-maritimes-2018/combo/json/seniors-affectation-agent.html b/templates/variants/alpes-maritimes-2018/combo/json/seniors-affectation-agent.html new file mode 100644 index 00000000..23c1d357 --- /dev/null +++ b/templates/variants/alpes-maritimes-2018/combo/json/seniors-affectation-agent.html @@ -0,0 +1,16 @@ +{% load combo %} + +{% if not json %} +

Erreur de configuration du portail. Cette page ne devrait pas être visible par un utilisateur non connecté.

+{% elif not user|has_role:"Gestionnaire des seniors" %} +

Erreur de configuration du portail. Cette page ne devrait pas être visible par un agent qui n'est pas gestionnaire des seniors.

+{% else %} +

Bonjour {{ json.first_name }}.

+ {% if not fiche %} +
+

Votre affectation n'est pas encore définie. Il vous faut la définir : définir votre affectation.

+
+ {% else %} +

Votre affectation est {{ fiche.fields.lieu_inscription }} (Modifier).

+ {% endif %} +{% endif %} diff --git a/templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-contenu.html b/templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-contenu.html new file mode 100644 index 00000000..6fa7ce15 --- /dev/null +++ b/templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-contenu.html @@ -0,0 +1,152 @@ +{% load combo %} + + +{% if json %} +

{{ json.title|default:"" }} {{ json.first_name }} {{ json.last_name|upper }}

+{% endif %} + + + +{% if not json and not fiche %} +

Ce senior n'existe pas.

+{% endif %} + +{% if not json and fiche %} +

Le compte en ligne de ce senior a été supprimé. Il n'est plus possible de modifier sa fiche ni de faire de nouvelle inscription.

+{% endif %} + +{% if fiche.fields.archive %} +

Le senior est archivé.

+{% endif %} + +{% if json and json.birthdate and json.birthdate|age_in_years|decimal < 55 %} +

Le senior a moins de 55 ans ({{ json.birthdate|date:"d/m/Y" }} soit {{ json.birthdate|age_in_years }} ans).

+{% endif %} + +{% if fiche.fields.adresse_erreur %} +

L'adresse est en erreur.

+{% endif %} + + + + +{% if json and not fiche %} +
+

Le senior dispose d'un compte. Il est désormais nécessaire de créer sa fiche pour l'inscrire à des activités : + créer la fiche du senior

+
+{% endif %} + + + + +{% if fiche %} +
+

Le senior est inscrit à {{ fiche.fields.lieu_inscription }}. {% if not fiche.fields.archive %}Modifier{% endif %}

+

+ {% if not fiche.fields.archive %}Fiche à imprimer{% endif %} + {% if fiche.fields.fiche_senior_signee %}- Fiche signée{% endif %} + {% if not fiche.fields.archive %}- {% if fiche.fields.fiche_senior_signee %}Modifier la fiche signée{% else %}Déposer la fiche signée{% endif %}{% endif %}

+
+{% endif %} + + + + + + + + + + + + + + +
+ {% if json %} + +

+ + + {% if json.title %}{% endif %} + + + {% if json.nom_de_naissance %}{% endif %} + {% if json.birthdate %}{% endif %} + {% if json.lieu_de_naissance %}{% endif %} +
État-civil{% if not fiche.fields.archive %}Modifier{% endif %}
Civilité{{ json.title }}
Prénom{{ json.first_name }}
Nom{{ json.last_name|upper }}
Nom de naissance{{ json.nom_de_naissance }}
Date de naissance{{ json.birthdate|date:"d/m/Y" }} ({{ json.birthdate|age_in_years }} ans)
Lieu de naissance{{ json.lieu_de_naissance }}
+

+ +

+ + + {% if json.address %}{% endif %} + {% if json.complement_d_adresse %}{% endif %} + {% if json.zipcode %}{% endif %} + {% if json.city %}{% endif %} +
Adresse{% if fiche.fields.adresse_erreur %} (En erreur){% endif%}{% if not fiche.fields.archive %}Modifier {% if fiche.fields.adresse_erreur %}Marquer l'adresse correcte{% else %}Marquer l'adresse en erreur{% endif %}{% endif %}
Adresse{% if json.numero_sur_la_voie %}{{ json.numero_sur_la_voie|upper }} {% endif %}{{ json.address|upper }}
Complément d'adresse{{ json.complement_d_adresse|upper }}
Code postal{{ json.zipcode }}
Ville{{ json.city|upper }}
+

+ +

+ + + {% if json.phone %}{% endif %} + {% if json.mobile %}{% endif %} + {% if json.email %}{% endif %} +
Téléphones / Email{% if not fiche.fields.archive %}Modifier{% endif %}
Téléphone fixe{{ json.phone|phonenumber_fr }}
Téléphone mobile{{ json.mobile|phonenumber_fr }}
Adresse email{{ json.email }}
+

+ + {% endif %} +
+ {% if fiche %} + +

+ + + {% if conjoint %} + + {% endif %} +
Conjoint{% if json %}{% if not fiche.fields.archive %}Modifier{% endif %}{% endif %}
Senior{{ conjoint.text }}
+

+ +

+ + + {% if fiche.fields.pc_nom_prenom or fiche.fields.pc_telephone or fiche.fields.pc_lien %} + + + + {% endif %} +
Personne à contacter{% if json %}{% if not fiche.fields.archive %}Modifier{% endif %}{% endif %}
Nom et prénom{{fiche.fields.pc_nom_prenom|default:""}}
Lien{{fiche.fields.pc_lien|default:""}}
Téléphone{{fiche.fields.pc_telephone|phonenumber_fr|default:""}}
+

+ +

+ + + + +
Documents{% if json %}{% if not fiche.fields.archive %}Modifier{% endif %}{% endif %}
RIB{% if fiche.fields.rib %}RIB du senior{% else %}Pas de RIB{% endif %}
Certificat médical{% if fiche.fields.cm %}Certificat - {{ fiche.fields.annee_cm }}{% else %}Pas de certificat{% endif %}
+

+ +

+ + + + + + + +
Autres renseignements{% if json %}{% if not fiche.fields.archive %}Modifier{% endif %}{% endif %}
PMR / Personne à Mobilité Réduite{% if fiche.fields.pmr %}Oui {% if fiche.fields.accompagnant %}avec{% else %}sans{% endif %} accompagnant{% else %}Non{% endif %}
Centres d'intérêt{{fiche.fields.ci|default:"Aucun centre d'intérêt"}}
Accepte d'être photographié pendant les activités ?{{ fiche.fields.okphoto }}
Canaux de contact{{ fiche.fields.canaux_contact|default:"Aucun" }}
Envoyer les courriers (dont brochure) ?{% if fiche.fields.non_envoi_brochure %}Non, car envoi au conjoint.{% else %}Oui{% endif %}
+

+ +

+ + + +
Mémo{% if json %}{% if not fiche.fields.archive %}Modifier{% endif %}{% endif %}
Mémo{% if fiche.fields.memo %}{{fiche.fields.memo|linebreaks}}{% else %}Pas de mémo.{% endif %}
+

+ + {% endif %} +
+ diff --git a/templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-sidebar.html b/templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-sidebar.html new file mode 100644 index 00000000..3fe5539c --- /dev/null +++ b/templates/variants/alpes-maritimes-2018/combo/json/seniors-page-senior-sidebar.html @@ -0,0 +1,44 @@ +{% load combo %} + +{% if json and fiche %} + +
+ +

Informations générales

+

Date de création : {{ fiche.receipt_time|date }}
+Par : {{ fiche.evolution.0.who.name }}

+{% if fiche.fields.url_historique %} +

Historique EUDONET

+{% endif %} + + + +

{% if not fiche.fields.archive %}Archiver le senior{% else %}Senior archivé (Réactiver le senior){% endif %}

+{% if fiche.fields.archive and user|has_role:"Administrateur des seniors" %} +

Suppression : +

+

+{% endif %} +

 

+ +
+ + + + + +{% endif %} -- 2.29.2