Refactor HTML structure for user marking templates to improve readability and maintainability
This commit is contained in:
@@ -3,20 +3,20 @@
|
||||
<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>
|
||||
<a href="{{ exam.get_absolute_url }}" class="fw-semibold">{{ exam.name }}</a>
|
||||
<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>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<a href="{{ exam.get_absolute_url }}" class="fw-semibold">{{ exam.name }}</a>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user