{% comment %} Partial: list of CID candidates for HTMX swap {% endcomment %}
{% if cid_users %}
    <ul class="list-group list-group-flush">
        {% for cid in cid_users %}
            <li class="list-group-item">
                <div class="d-flex align-items-start justify-content-between">
                    <div>
                        <div class="d-flex align-items-center">
                            <i class="bi bi-clock-history text-muted me-2" title="View user exam history"
                               hx-get="{% url exam.app_name|add:':exam_user_status_cid' exam.id cid.cid %}"
                               hx-target=".modal-content"
                               data-bs-toggle="modal"
                               data-bs-target="#history-modal"
                            ></i>
                            <a class="fw-bold me-2 cid-link" href="{% url 'generic:update_cid' cid.pk %}">{{ cid.cid }}</a>
                            <span class="text-muted">[{{ cid.passcode }}]</span>
                            <a class="ms-3" title="View CID exam details" hx-get="{% url 'generic:cid_user_exam_partial' exam.app_name exam.id cid.cid %}" hx-target=".modal-content" data-bs-toggle="modal" data-bs-target="#history-modal"><i class="bi bi-box-arrow-up-right"></i></a>
                        </div>
                        <div class="small text-muted mt-1">{{ cid.name }}</div>
                        <div class="small">Email: {{ cid.email }}</div>
                        {% if cid.notes %}
                            <div class="small text-muted mt-1 cid-notes" title="{{ cid.notes|escape }}" data-bs-toggle="tooltip" data-bs-placement="top">Notes: {{ cid.notes|truncatechars:120 }}</div>
                        {% endif %}
                    </div>
                    <div class="badge-container d-flex align-items-center ms-3"></div>
                </div>
            </li>
        {% endfor %}
    </ul>
{% else %}
    <p class="text-muted">This exam has no CID candidates.</p>
{% endif %}
