landes-cd40: add json cell for department demands (#85723)
gitea/publik-base-theme/pipeline/head This commit looks good Details

This commit is contained in:
Serghei Mihai 2024-01-11 12:04:35 +01:00
parent 01b53bcddc
commit 8f0b251fb8
2 changed files with 59 additions and 0 deletions

View File

@ -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
}
]
}
}
}

View File

@ -0,0 +1,34 @@
{% if title %}
<h2 class="cell--title">{{ title }}</h2>
{% endif %}
{% if json.err and extranet.err and transmlph.err %}
<div class="cell--body">
<p class="empty-message">Informations indisponibles.</p>
</div>
{% else %}
{% with json.data|add:extranet.data|add:transmlph.data as data %}
{% if data %}
<div class="links-list current-forms list-of-forms">
<ul>
{% for item in data|dictsortreversed:"datetime" %}
<li class="{{item.status_css_class}} {% if item.form_status_is_endpoint %}done{% endif %}"><a {% if item.url %}href="{{ item.url }}"{% endif %}>
<span class="form-title">{{item.name}}</span>
{% if item.draft %}
<span class="form-number">{{item.datetime|strptime:"%Y-%m-%d %H:%M:%S"}}</span>
{% else %}
<span class="form-number">{{item.form_number}}
{% if item.form_digest %}<span class="form-digest">({{item.form_digest}})</span>{% endif %}
</span>
{% endif %}
<span class="form-status">{{item.status}}</span></a></li>
{% endfor %}
</ul>
</div>
{% else %}
<div class="cell--body">
<p class="empty-message">Aucune demande.</p>
</div>
{% endif %}
{% endwith %}
{% endif %}