<div class="user-marking-list">
  {% if exams_data %}
    <ul class="list-group">
      {% for item in exams_data %}
        {% with exam=item.exam %}
          <li class="list-group-item d-flex justify-content-between align-items-center">
            <div>
              {% if exam_type == 'anatomy' %}
                <a href="{% url exam_type|add:':mark2_overview' pk=exam.pk %}" class="fw-semibold">{{ exam.name }}</a>
              {% else %}
                <a href="{% url exam_type|add:':mark_overview' pk=exam.pk %}" class="fw-semibold">{{ exam.name }}</a>
              {% endif %}
              <div class="small text-muted">Authors: {% for a in exam.author.all %}{{ a.get_full_name|default:a.username }}{% if not forloop.last %}, {% endif %}{% endfor %}</div>
            </div>
            <div class="text-end">
              <div class="small text-muted">Markers: {{ exam.markers.all.count }}</div>
              {% if item.has_unmarked %}
                <span class="badge bg-danger mt-1">Needs marking ({{ item.unmarked_count }})</span>
              {% else %}
                <span class="badge bg-secondary mt-1">No unmarked</span>
              {% endif %}
            </div>
          </li>
        {% endwith %}
      {% endfor %}
    </ul>
  {% else %}
    <div class="alert alert-info mb-0">No exams found for this exam type.</div>
  {% endif %}
</div>
