+
+<script>
+var slideIndex = 1;
+showDivs(slideIndex);
+
+function plusDivs(n) {
+ showDivs(slideIndex += n);
+}
+
+function showDivs(n) {
+ var i;
+ var x = document.getElementsByClassName("model");
+ if (n > x.length) {slideIndex = 1}
+ if (n < 1) {slideIndex = x.length}
+ for (i = 0; i < x.length; i++) {
+ x[i].style.display = "none";
+ }
+ x[slideIndex-1].style.display = "block";
+}
+</script>
+
+{% if not task.done %}
+<script>
+function worker() {
+ $.ajax({
+ data:{csrfmiddlewaretoken: '{{ csrf_token }}'},
+ url: "/refresh_done/",
+ type:"post",
+ success: function(data) {
+ document.location.reload();
+ },
+ complete: function() {
+ // Schedule the next request when the current one's complete
+ setTimeout(worker, 30000);
+ }
+ });
+};
+$(document).ready(function() {
+ // run the first time; all subsequent calls will take care of themselves
+ setTimeout(worker, 30000);
+});
+</script>
+{% endif %}