From 332e7e76489bf83ec5fb7458dc86f88b8fe6919f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 5 May 2026 20:24:06 +0000 Subject: [PATCH] Replace tree_node.html include with inline Django 6.0 partialdef The recursive tree_node.html file is folded into tree.html using {% partialdef tree_node %} / {% partial tree_node %}. Context is passed via {% with node=child %}, which works because PartialNode uses DeferredSubDict for runtime lookup, making recursive self-reference safe. https://claude.ai/code/session_01M6L96N8QWgnkDqGCYobb4d --- moderation/templates/moderation/tree.html | 25 ++++++++++++++++++- .../templates/moderation/tree_node.html | 20 --------------- 2 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 moderation/templates/moderation/tree_node.html diff --git a/moderation/templates/moderation/tree.html b/moderation/templates/moderation/tree.html index ed7d0f5b..2aad2283 100644 --- a/moderation/templates/moderation/tree.html +++ b/moderation/templates/moderation/tree.html @@ -3,6 +3,29 @@ {% block title %}Arbre de modération{% endblock %} {% block content %} + {% partialdef tree_node %} +
  • +
    + {% if not is_root %} + + {% endif %} + {{ node.user.netid }} + {{ node.user.name }} + ({{ node.user.action_count }} action{{ node.user.action_count|pluralize }} de modération, {{ node.user.document_count }} document{{ node.user.document_count|pluralize }}) + {% if node.user.is_staff %} + Admin + {% endif %} +
    + {% if node.children %} + + {% endif %} +
  • + {% endpartialdef tree_node %} +