{% extends "base.html" %}
{% block title %}{{ status_label }} merge candidates · goon{% endblock %}

{% block content %}
  <div class="toolbar">
    <strong>{{ status_label }}</strong>
    <span class="muted">· {{ total }} total</span>
  </div>

  {% if items %}
    {% for it in items %}
      <div class="card">
        <div class="row" style="align-items:center;">
          <div class="col">
            <div>
              <a href="/ui/candidate/{{ it.id }}">
                <strong>{{ it.left_title or it.left_id }}</strong>
              </a>
              <span class="muted">↔</span>
              <a href="/ui/candidate/{{ it.id }}">
                <strong>{{ it.right_title or it.right_id }}</strong>
              </a>
            </div>
            <div class="muted">{{ it.kind }} · {{ it.status }}</div>
          </div>
          <div class="col" style="text-align:right;flex:0 0 100px;">
            <span class="score {{ score_class(it.score) }}">{{ '%.2f' % it.score }}</span>
          </div>
        </div>
      </div>
    {% endfor %}

    {% if total > per_page %}
      <div class="toolbar" style="margin-top:24px;">
        {% if page > 1 %}
          <a href="?status={{ status }}&page={{ page - 1 }}">← prev</a>
        {% endif %}
        <span class="muted">page {{ page }} of {{ ((total - 1) // per_page) + 1 }}</span>
        {% if page * per_page < total %}
          <a href="?status={{ status }}&page={{ page + 1 }}">next →</a>
        {% endif %}
      </div>
    {% endif %}
  {% else %}
    <div class="card muted">No candidates with status = {{ status }}.</div>
  {% endif %}
{% endblock %}
