From ebad9c6bd919817fee9d87249608a23c853fc620 Mon Sep 17 00:00:00 2001 From: Ross Date: Thu, 6 Nov 2025 22:01:57 +0000 Subject: [PATCH] Refactor exam date handling to use start_date instead of date in bulk update functionality --- generic/templates/generic/exam_index.html | 91 +++++++++++++++-------- generic/views.py | 2 +- 2 files changed, 62 insertions(+), 31 deletions(-) diff --git a/generic/templates/generic/exam_index.html b/generic/templates/generic/exam_index.html index 0c4ad510..4dd091de 100644 --- a/generic/templates/generic/exam_index.html +++ b/generic/templates/generic/exam_index.html @@ -1,33 +1,42 @@ {% extends app_name|add:'/base.html' %} {% block content %} -
+
+
- - +
-
- {% for k, v in request.GET.items %} - - {% endfor %} - {% csrf_token %} -
- - +
+
+ +
- -
- {% for k, v in request.GET.items %} - - {% endfor %} - {% csrf_token %} - -
-
-
- {% include 'generic/partials/_exam_list.html' with filter=filter app_name=app_name %} +
+ {% for k, v in request.GET.items %} + + {% endfor %} + {% csrf_token %} +
+ + +
+
+ +
+ {% for k, v in request.GET.items %} + + {% endfor %} + {% csrf_token %} + +
+
+
+
+ + {% include 'generic/partials/_exam_list.html' with filter=filter app_name=app_name %} +
{% include "generic/partials/filter_bar.html" with filter=filter app_name=app_name collapse_id="bottom-filter-body" %} {% endblock %} @@ -40,25 +49,47 @@ float: right; opacity: 50%;} + /* Hide selection checkboxes unless bulk-mode is enabled on the wrapper */ + #exam-list-wrapper input.exam-select-checkbox { display: none; } + #exam-list-wrapper.bulk-mode input.exam-select-checkbox { display: inline-block; } + + /* Show bulk controls area only when not d-none (toggled by JS) */ + {% endblock css %} -{% block extra_js %} +{% block js %} diff --git a/generic/views.py b/generic/views.py index 8ed1217f..57a1c38c 100644 --- a/generic/views.py +++ b/generic/views.py @@ -1045,7 +1045,7 @@ class ExamViews(View, LoginRequiredMixin): continue if new_date is not None: - exam.date = new_date + exam.start_date = new_date exam.save() return render(request, "generic/partials/_exam_list.html", {"filter": filter, "app_name": self.app_name})