start taking more advantage of class based views
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user