From 8f0b251fb81be474e61cce655a5646397eb72637 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Thu, 11 Jan 2024 12:04:35 +0100 Subject: [PATCH] landes-cd40: add json cell for department demands (#85723) --- static/landes-cd40/config.json | 25 ++++++++++++++ .../combo/json/department-demands.html | 34 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 templates/variants/landes-cd40/combo/json/department-demands.html diff --git a/static/landes-cd40/config.json b/static/landes-cd40/config.json index 5995d14d..eb9a6219 100644 --- a/static/landes-cd40/config.json +++ b/static/landes-cd40/config.json @@ -111,6 +111,31 @@ "log_errors": false, "cache_duration": 0, "force_async": true + }, + "department-demands": { + "name": "Demandes du département", + "url": "{{ passerelle_url }}proxy/phe/request/api_publik.php?sub={{ user_nameid }}", + "form": [ + {"label": "Titre de la cellule", "varname": "title", "required": false} + ], + "varnames": ["user_id"], + "log_errors": false, + "cache_duration": 5, + "force_async": true, + "additional-data": [ + { + "key": "extranet", + "url": "{{ passerelle_url }}proxy/extranet/request/api_publik.php?sub={{ user_nameid }}", + "cache_duration": 5, + "log_errors": false + }, + { + "key": "transmlph", + "url": "{{ passerelle_url }}proxy/transmlph/request/api_publik.php?sub={{ user_nameid }}", + "cache_duration": 5, + "log_errors": false + } + ] } } } diff --git a/templates/variants/landes-cd40/combo/json/department-demands.html b/templates/variants/landes-cd40/combo/json/department-demands.html new file mode 100644 index 00000000..402eb218 --- /dev/null +++ b/templates/variants/landes-cd40/combo/json/department-demands.html @@ -0,0 +1,34 @@ +{% if title %} +

{{ title }}

+{% endif %} + +{% if json.err and extranet.err and transmlph.err %} +
+

Informations indisponibles.

+
+{% else %} + {% with json.data|add:extranet.data|add:transmlph.data as data %} + {% if data %} + + {% else %} +
+

Aucune demande.

+
+ {% endif %} + {% endwith %} +{% endif %}