{% if routes %} {% for route in routes %}
{{ route.cost|floatformat:1 }} m {{ route.hop_count }} hop{{ route.hop_count|pluralize }}
{# Interleaved hop list: structure → pathway → structure → ... #}
{% for hop in route.hops %} {% if hop.kind == "structure" %}
{{ hop.label }} {{ hop.type }}
{% elif hop.kind == "pathway" %}
{{ hop.label }} {% if hop.length %}{{ hop.length|floatformat:0 }}m{% endif %}
{% endif %} {% endfor %}
{% if cable_pk %}
{% csrf_token %}
{% endif %}
{% csrf_token %} {% if cable_pk %}{% endif %}
{% endfor %} {# Route geometry for map rendering #} {% if route_geometry_json %} {% endif %} {% else %}

No route found with the given constraints.

{% endif %}