{% extends 'base.html' %} {% block title %}Bibliothèque — Admin OpenCare{% endblock %} {% block content %}
{% include 'admin/_sidebar.html' %}
{# ── Header ─────────────────────────────────────────────────────── #}

Bibliothèque

{{ recs|length }} recommandation(s) approuvée(s) et active(s)

A {{ ev_total.A }} B {{ ev_total.B }} C {{ ev_total.C }}
File d'attente
{% if recs %} {# ── Cockpit body ────────────────────────────────────────────────── #}
{# ── Left tree nav ──────────────────────────────────────────────── #}
{% for domain_key, label in domain_labels.items() %} {% if domain_key in tree %} {% set node = tree[domain_key] %}
{% if node.tags %}
{% for tag, tnode in node.tags.items()|sort %} {% endfor %}
{% endif %}
{% endif %} {% endfor %}
{# ── Right cards panel ──────────────────────────────────────────── #}

Aucune recommandation dans cette catégorie.

{% for rec in recs %} {% set is_universal = not rec.required_conditions and not rec.required_health_goals and not rec.required_diet_types and not rec.required_activity_levels %} {% set has_gates = rec.not_for_under_18 or rec.not_for_pregnant or (rec.target_sex and rec.target_sex != 'all') or rec.target_age_min or rec.target_age_max or rec.excluded_conditions %}
{# Card header — click to expand #} {# Card body — collapsible #}
{% if rec.summary %}

{{ rec.summary }}

{% endif %} {% if rec.details %}

{{ rec.details }}

{% endif %} {# Intervention + Effect #} {% if rec.intervention or rec.effect %}
{% if rec.intervention %}
Intervention
{{ rec.intervention }}
{% endif %} {% if rec.effect %}
Effet attendu
{{ rec.effect }}
{% endif %}
{% endif %} {# Source citation #} {% if rec.source_title %}
{{ rec.source_title }} {% if rec.source_doi %} — {{ rec.source_doi }}{% endif %} {% if rec.study_type %}{{ rec.study_type.replace('_',' ') }}{% endif %}
{% endif %} {# ── Targeting breakdown ─────────────────────────────────── #}
Ciblage profil {% if is_universal %} 🌍 Universel — affiché à tous {% else %} 🎯 Conditionnel {% endif %}
{% if has_gates %}
Exclusions (portes dures — toutes doivent passer)
{% if rec.not_for_under_18 %}✗ Pas < 18 ans{% endif %} {% if rec.not_for_pregnant %}✗ Pas grossesse{% endif %} {% if rec.target_sex == 'male' %}♂ Hommes uniquement{% endif %} {% if rec.target_sex == 'female' %}♀ Femmes uniquement{% endif %} {% if rec.target_age_min %}≥ {{ rec.target_age_min }} ans{% endif %} {% if rec.target_age_max %}≤ {{ rec.target_age_max }} ans{% endif %} {% for c in rec.excluded_conditions %} Exclu si: {{ condition_labels.get(c, c) }} {% endfor %}
{% endif %} {% if not is_universal %}
Déclencheurs — logique OU (un groupe suffit)
{% for c in rec.required_conditions %} Si: {{ condition_labels.get(c, c) }} {% endfor %} {% for g in rec.required_health_goals %} Objectif: {{ goal_labels.get(g, g) }} {% endfor %} {% for d in rec.required_diet_types %} Régime: {{ diet_labels.get(d, d) }} {% endfor %} {% for a in rec.required_activity_levels %} Activité: {{ activity_labels.get(a, a) }} {% endfor %}
{% else %}

Aucun critère de déclenchement — affichée à tous les utilisateurs (sous réserve des exclusions ci-dessus si définies).

{% endif %}
{# Actions #}
{# ── Edit targeting modal ───────────────────────────────────── #} {% endfor %}
{% else %}

Aucune recommandation approuvée. Allez dans la file d'attente pour en valider.

File d'attente
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}