aemo_fr/templates/aemo/famille_list.html
2024-06-03 16:49:01 +02:00

157 lines
7.7 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block extra_javascript %}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll("#id_niveau, #id_interv, #id_equipe").forEach(el => {
el.addEventListener('change', (ev) => { ev.target.form.submit(); });
});
});
</script>
{% endblock %}
{% block boutons_droite %}
<div class="topnav-right text-start float-end">
<form method="get" action=".">
<div class="form-floating float-start pb-2">
{{ form.duos }}{{ form.duos.label_tag }}
</div>
<div class="form-floating float-start pb-2 ms-1">
{{ form.ressource }}{{ form.ressource.label_tag }}
</div>
<div class="form-floating float-start pb-2 ms-1">
{{ form.equipe }}{{ form.equipe.label_tag }}
</div>
<div class="form-floating float-start ms-1">
{{ form.interv }}{{ form.interv.label_tag }}
</div>
<div class="form-floating float-start ms-1" style="width:8em;">
{{ form.niveau }}{{ form.niveau.label_tag }}
</div>
<div class="float-start input-group ms-1 mt-2" style="width:16em;">
{{ form.nom }}
<button class="px-2" type="submit" title="Rechercher">
<img src="{% static 'admin/img/search.svg' %}">
</button>
<button id="reset-button" class="ms-1" type="reset" title="Réinitialiser tous les filtres">
<img src="{% static 'img/filter_off.svg' %}">
</button>
</div>
</form>
</div>
{% endblock %}
{% block content %}
<div class="row border-bottom mb-3">
<div class="col"><p class="lead">Familles {% if view.mode == 'attente' %}- Liste dattente{% endif %}</p></div>
<div class="col text-end" >
{% if view.mode == 'attente' %}
<a class="btn btn-sm btn-outline-primary" href="{% url 'famille-list' %}">Liste</a>
{% else %}
<a class="btn btn-sm btn-outline-primary" href="{% url 'famille-attente' %}">Liste dattente</a>
{% endif %}
{% if perms.aemo.add_famille %}
<a class="btn btn-sm btn-outline-primary" href="{% url 'famille-add' %}">Nouvelle famille</a>
{% endif %}
</div>
</div>
<div class="row">
<div class="col">
<table id="benef_table" class="table table-sm table-hover sortable">
<thead class="table-light">
<tr>
{% for label in labels %}
<th>{{ label }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for famille in object_list %}
{% with suivi=famille.suivi %}
<tr data-statut="{{ suivi.etape.code }}" data-intervenant="{{ suivi|referents_pk_data }}">
{% for col_key in col_keys %}
{% if col_key == 'nom' %}
<td>
<div>
<a href="{% url 'famille-suivi' famille.pk %}" title="Suivi">{{ famille.nom }}</a>
<span class="hoverimage">
<a class="btn btn-sm m-0 p-0" role="button"
href="{% url 'famille-edit' famille.pk %}"
title="{{ famille.telephone }}">
<img src="{% static 'img/coordonnees.gif' %}" width="15" height="15">
</a>
</span>
</div>
</td>
{% elif col_key == 'localite' %}
<td>{{ famille.npa}} {{ famille.localite }}</td>
{% elif col_key == 'referents' %}
<td>{{ suivi|sigles_referents }}</td>
{% elif col_key == 'referents_ope' %}
<td>
{{ suivi.ope_referent|info_ope }}
</td>
{% elif col_key == 'suivi' %}
<td data-sort="{{ famille.suivi.etape.num }}">
<table class="statut_suivi">
<tr><td>{{ suivi|etape_cellule:"demande" }}</td>
<td>{{ suivi|etape_cellule:"debut_evaluation" }}</td>
<td>{{ suivi|etape_cellule:"fin_evaluation" }}</td>
<td>{{ suivi|etape_cellule:"debut_suivi" }}</td>
<td>{{ suivi|etape_cellule:"bilan_suivant" }}</td>
<td>{{ suivi|etape_cellule:"resume" }}</td>
<td>{{ suivi|etape_cellule:"fin_suivi" }}</td>
</tr>
</table>
</td>
{% elif col_key == 'prioritaire' %}
<td class="text-center">{{ suivi.demande_prioritaire|yesno:'Oui,' }}</td>
{% elif col_key == 'niveau_interv' %}
<td class="text-center">{{ famille.niveau_interv|default_if_none:'-' }}</td>
{% elif col_key == 'date_demande' %}
<td data-sort="{{ suivi.date_demande|date:'Ymd' }}">
{{ suivi.date_demande|date:"d.m.Y" }}
</td>
{% elif col_key == 'region' %}
<td>{{ famille.region.nom }}</td>
{% elif col_key == 'evaluation' %}
{% if suivi.date_fin_evaluation %}<td class="green">Terminée le {{ suivi.date_fin_evaluation }}</td>
{% elif suivi.date_debut_evaluation %}<td class="orange">En cours</td>
{% else %}<td class="red">À faire</td>{% endif %}
{% endif %}
{% endfor %}
</tr>
{% endwith %}
{% empty %}
<td colspan="8" class="bg-warning" align="center">
<i>Aucune famille ne correspond à votre recherche.</i>
</td>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% if can_view_rdvs %}
<div class="alert alert-secondary">
{% if duo_rdv_passes %}
<div>Derniers RdV:
{% for rdv in duo_rdv_passes %}{% if not forloop.first %}, {% endif %}{{ rdv.rendez_vous|date:'d.m.Y' }}{% endfor %}
</div>
{% endif %}
<div>
Prochain RdV pour {{ form.duos.value }}:
{% if can_edit_rdvs %}<a href="{% url 'duo-date-change' form.duos.value %}" class="js-edit">{% endif %}
{% if prochain_duo_rdv %}{{ prochain_duo_rdv.rendez_vous|date:'d.m.Y' }}{% else %}<i>à définir</i>{% endif %}
{% if can_edit_rdvs %}</a>{% endif %}
</div>
</div>
{% endif %}
{% if ma_charge %}
<div class="alert alert-info">
Ma charge actuelle: {{ ma_charge.nbre_eval }} familles en éval., {{ ma_charge.nbre_suivi }} familles suivies, {{ ma_charge.heures|default_if_none:0 }}h. hebdo (sur max. {{ user.charge_max}}h)
</div>
{% endif %}
{% endblock %}