From bcfcd8da82c8de7a000f071d2fcca9014bd4c944 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 8 Jul 2024 10:10:51 +0100 Subject: [PATCH] tidy up exam list a little --- generic/views.py | 3 +-- templates/exam_list.html | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/generic/views.py b/generic/views.py index 87165676..780ddd98 100644 --- a/generic/views.py +++ b/generic/views.py @@ -542,7 +542,6 @@ class ExamViews(View, LoginRequiredMixin): @method_decorator(login_required) def exam_toggle_archived(self, request, pk): - print("TOGGLE ARCHIVED", request.POST) if request.method == "POST": if not self.check_user_edit_access(request.user): data = {"status": "error, insufficient permission"} @@ -556,7 +555,7 @@ class ExamViews(View, LoginRequiredMixin): data = { "status": "success", "archive": exam.archive, - "name": exam, + "name": str(exam), "id": exam.id, } return JsonResponse(data, status=200) diff --git a/templates/exam_list.html b/templates/exam_list.html index 79e8557e..6461aaa7 100644 --- a/templates/exam_list.html +++ b/templates/exam_list.html @@ -20,11 +20,9 @@ - - {% if view_all %} + - - {% endif %} + {% endif %} {% endfor %} @@ -52,11 +50,9 @@ - - {% if view_all %} - - - {% endif %} + + + {% endif %} {% endfor %} @@ -82,7 +78,7 @@ color: purple; } - .published-icon, .active-icon, .archived-icon { + .published-icon, .active-icon { border: 1px dotted gray; opacity: 20%; border-radius: 4px; @@ -93,6 +89,12 @@ text-align: center; } + .archived-icon { + color: darkgray; + opacity: 20%; + padding-inline-start: 10px; + } + .published-icon:hover, .active-icon:hover, .archived-icon:hover { opacity: 100%; } @@ -112,10 +114,8 @@ } .exam-archived-switch:checked + .archived-icon { - border: 1px solid darkblue; color: darkblue; opacity: 100%; - display: inline-block; } .exam-publish-results-switch, .exam-active-switch, .exam-archived-switch { @@ -135,6 +135,9 @@ .exam-list-edit-button:hover { opacity: 100%; } + .flex-shrink { + flex-shrink: 1; + } {% endblock %}