From 00a675b71538b008d62b3545b9c8c56f6a183fcf Mon Sep 17 00:00:00 2001 From: Ross Date: Fri, 7 Nov 2025 22:13:09 +0000 Subject: [PATCH] Refactor exam collections list to use Bootstrap cards for improved layout and add total exam count display --- .../generic/examcollection_list.html | 61 ++++++++++++++++--- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/generic/templates/generic/examcollection_list.html b/generic/templates/generic/examcollection_list.html index b2a7487b..5f2f1743 100755 --- a/generic/templates/generic/examcollection_list.html +++ b/generic/templates/generic/examcollection_list.html @@ -2,15 +2,60 @@ {% block content %} -

Exam Collections

- +

Exam Collections

+{% if object_list %} +
+ {% for collection in object_list %} +
+
+
+
+ {{ collection.name }} + {% if collection.date %} +
Date: {{ collection.date }}
+ {% endif %} +
+ +
+ Authors: {{ collection.get_authors }} +
+ +
+ {% comment %} Show archive state and counts per exam type {% endcomment %} + {% if collection.archive %} + Archived + {% endif %} + + {# Total exams count (sum of known related exam sets) #} + {% with a=collection.anatomy_exams.count l=collection.longs_exams.count p=collection.physics_exams.count r=collection.rapids_exams.count s=collection.sbas_exams.count %} + {% with total=a|add:l|add:p|add:r|add:s %} + {{ total }} exams + {% endwith %} + {# Per-type badges (only show non-zero) #} + {% if a %}Anatomy {{ a }}{% endif %} + {% if l %}Longs {{ l }}{% endif %} + {% if p %}Physics {{ p }}{% endif %} + {% if r %}Rapids {{ r }}{% endif %} + {% if s %}SBAs {{ s }}{% endif %} + {% endwith %} +
+ +
+ View + {% if can_edit %} + Edit + Clone + {% endif %} +
+
+
+
+ {% endfor %} +
+{% else %} +
No exam collections yet.
+{% endif %} {% endblock %}