start taking more advantage of class based views

This commit is contained in:
Ross
2024-03-11 11:08:35 +00:00
parent 78e4ed871e
commit 0cb38f5c31
27 changed files with 244 additions and 104 deletions
+19 -15
View File
@@ -1,10 +1,14 @@
{% extends 'sbas/exams.html' %}
{% block navigation %}
{{ block.super }}
{% include 'generic/exam_overview_headers.html' %}
{% endblock navigation %}
{% block content %}
{% load thumbnail %}
<div class="sbas">
{% include 'generic/exam_overview_headers.html' %}
This exam will be available to take <a href="{% url 'sbas:exam_start' pk=exam.pk %}">here</a> (when active).
@@ -47,17 +51,17 @@
})
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
.done(function (data) {
console.log(data);
console.log(data);
if (data.status == "success") {
toastr.info('Exam state changed.')
}
if (data.status == "success") {
toastr.info('Exam state changed.')
}
// show some message according to the response.
// For eg. A message box showing that the status has been changed
})
})
.always(function () {
console.log('[Done]');
})
console.log('[Done]');
})
})
$("#exam-publish-results-switch").on("change", function () {
$.ajax({
@@ -71,17 +75,17 @@
})
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
.done(function (data) {
console.log(data);
console.log(data);
if (data.status == "success") {
toastr.info('Publish results state changed.')
}
if (data.status == "success") {
toastr.info('Publish results state changed.')
}
// show some message according to the response.
// For eg. A message box showing that the status has been changed
})
})
.always(function () {
console.log('[Done]');
})
console.log('[Done]');
})
})
});
</script>