{% extends "base.html" %} {% block titre %}Catégories - Gestion de stock IT{% endblock %} {# Macro récursive : un nœud de l'arborescence (profondeur illimitée) et ses enfants.
est replié par défaut pour qu'un arbre profond ou avec beaucoup de branches reste lisible sans tout afficher d'un coup. #} {% macro noeud_categorie(categorie) %}
  • {{ categorie.nom }} {%- if categorie.enfants %}{{ categorie.enfants|length }} sous-cat.{% endif -%} {%- if categorie.enfants and categorie.materiels %} · {% endif -%} {%- if categorie.materiels %}{{ categorie.materiels|length }} matériel(s){% endif -%}
    {% if not categorie.enfants and not categorie.materiels %}
    {% endif %}
    {% if categorie.enfants %}
      {% for enfant in categorie.enfants %} {{ noeud_categorie(enfant) }} {% endfor %}
    {% endif %}
  • {% endmacro %} {% block contenu %}

    Catégories

    {% if q %}Effacer{% endif %}
    {% if q %} {% if resultats %} {% else %}

    Aucune catégorie ne correspond à « {{ q }} ».

    {% endif %} {% else %} {% if racines %} {% else %}

    Aucune catégorie pour l'instant.

    {% endif %} {% endif %} {% endblock %}