tidy up exam list a little
This commit is contained in:
+1
-2
@@ -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)
|
||||
|
||||
+15
-12
@@ -20,11 +20,9 @@
|
||||
<label for="active-{{exam.pk}}" class="flex-col icon-container active-icon" title="Click to toggle active state">Exam Active</label>
|
||||
<input type="checkbox" id="published-{{exam.pk}}" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}" {% if exam.publish_results %}checked{% endif %}>
|
||||
<label for="published-{{exam.pk}}" class="flex-col icon-container published-icon" title="Click to toggle published state">Results Published</label>
|
||||
<a href="{% url app_name|add:':exam_update' pk=exam.pk %}" class="flex-col exam-list-edit-button"><i class="bi bi-pencil-square"></i></a>
|
||||
{% if view_all %}
|
||||
<a href="{% url app_name|add:':exam_update' pk=exam.pk %}" class="flex-shrink exam-list-edit-button"><i class="bi bi-pencil-square"></i></a>
|
||||
<input type="checkbox" id="archived-{{exam.pk}}" class="exam-archived-switch" data-posturl="{% url app_name|add:':exam_toggle_archived' pk=exam.pk %}" {% if exam.archive %}checked{% endif %}>
|
||||
<label for="archived-{{exam.pk}}" class="flex-col icon-archive archived-icon" title="Click to toggle archived state">Archived</label>
|
||||
{% endif %}
|
||||
<label for="archived-{{exam.pk}}" class="flex-shrink icon-archive archived-icon" title="Click to toggle archived state"><i class="bi bi-archive"></i></label>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -52,11 +50,9 @@
|
||||
<label for="active-{{exam.pk}}" class="flex-col icon-container active-icon" title="Click to toggle active state">Exam Active</label>
|
||||
<input type="checkbox" id="{{exam.pk}}-pub" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}" {% if exam.publish_results %}checked{% endif %}>
|
||||
<label for="{{exam.pk}}-pub" class="flex-col icon-container published-icon">Results Published</label>
|
||||
<a href="{% url app_name|add:':exam_update' pk=exam.pk %}" class="flex-col exam-list-edit-button"><i class="bi bi-pencil-square"></i></a>
|
||||
{% if view_all %}
|
||||
<input type="checkbox" id="archived-{{exam.pk}}" class="exam-archived-switch" data-posturl="{% url app_name|add:':exam_toggle_archived' pk=exam.pk %}" {% if exam.archive %}checked{% endif %}>
|
||||
<label for="archived-{{exam.pk}}" class="flex-col icon-archive archived-icon" title="Click to toggle archived state">Archived</label>
|
||||
{% endif %}
|
||||
<a href="{% url app_name|add:':exam_update' pk=exam.pk %}" class="flex-shrink exam-list-edit-button"><i class="bi bi-pencil-square"></i></a>
|
||||
<input type="checkbox" id="archived-{{exam.pk}}" class="exam-archived-switch" data-posturl="{% url app_name|add:':exam_toggle_archived' pk=exam.pk %}" {% if exam.archive %}checked{% endif %}>
|
||||
<label for="archived-{{exam.pk}}" class="flex-shrink icon-archive archived-icon" title="Click to toggle archived state"><i class="bi bi-archive"></i></label>
|
||||
</li>
|
||||
{% 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;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user