{% load i18n %}
{# ── Header ────────────────────────────────────────────────────────────── #}
{% if full_graph_url %} View full graph → {% endif %}
{# ── Summary pills ─────────────────────────────────────────────────────── #}
{% if request_app %} view: {{ request_app }} {% endif %} {% if import_cycle_count %} ⟳ {{ import_cycle_count }} import cycle{{ import_cycle_count|pluralize }} {% endif %} {% if fk_cycle_count %} ⟳ {{ fk_cycle_count }} FK cycle{{ fk_cycle_count|pluralize }} {% endif %} {% if violation_count %} ⚠ {{ violation_count }} violation{{ violation_count|pluralize }} {% endif %} {% if not has_grimp %} import edges unavailable — pip install grimp {% endif %}
{# ── Request tab ───────────────────────────────────────────────────────── #}
{% if request_rows %} {% for row in request_rows %} {% endfor %}
App Imports from Imported by FK targets Cycles / violations
{{ row.name }} {% if row.name == request_app %}view{% endif %} {% if row.is_third_party %}3P{% endif %} {% if row.in_violation %}violation{% endif %} {% if row.imports_from %}
{% for dep in row.imports_from %} {{ dep }} {% endfor %}
{% else %} {% endif %}
{% if row.imported_by %}
{% for dep in row.imported_by %} {{ dep }} {% endfor %}
{% else %} {% endif %}
{% if row.fk_targets %}
{% for dep in row.fk_targets %} {{ dep }} {% endfor %}
{% else %} {% endif %}
{% if row.cycle_kind == "import" %} ⟳ import {% elif row.cycle_kind == "fk" %} ⟳ FK {% elif row.cycle_kind == "both" %} ⟳ import ⟳ FK {% endif %} {% if row.cycle_label %}
{{ row.cycle_label }}
{% endif %}
{% else %}

Could not resolve a Django app for this request.
This can happen for static files, DjDT's own URLs, or middleware-intercepted responses.

{% endif %}
{# ── All Apps tab ──────────────────────────────────────────────────────── #}
{# /djdt-depmap #}