{% load i18n prometric_extras %} {% comment %}Side-by-side comparison tables, one card per section. Context: sections (from snapshots.comparison / route_comparison), columns (Snapshot list, the first one is the baseline), current (optional Snapshot whose column is not linked).{% endcomment %} {% for section in sections %}

{{ section.title|default:section.name }}

{% if section.title %}{{ section.name }}{% endif %}
{% for snap in columns %} {% endfor %} {% for row in section.rows %} {% for cell in row.cells %} {% endfor %} {% endfor %}
{{ section.first_column }} {% if snap.pk == current.pk %}{{ snap.taken_at|date:"M j, Y H:i" }} {% else %}{{ snap.taken_at|date:"M j, Y H:i" }}{% endif %} {% if columns|length > 1 and forloop.first %}{% translate "baseline" %}{% endif %}
{% if row.mono %}{{ row.label }}{% else %}{{ row.label }}{% endif %} {% if cell.value == None %} {% elif row.is_bytes %}{{ cell.value|size }}{% elif row.is_rate %}{{ cell.value|pct }}{% elif row.unit == "ms" %}{{ cell.value|ms }}{% else %}{{ cell.value|num }}{% endif %} {% if cell.delta != None %}
{{ cell.delta|delta }}
{% endif %}
{% endfor %}