From c74b02bca71274364f749b1ef2358a64437fcf03 Mon Sep 17 00:00:00 2001
From: Jonathan Weth <git@jonathanweth.de>
Date: Sat, 13 Jun 2020 15:58:16 +0200
Subject: [PATCH] Show warning and indeterminate progress bar, if JS isn't
 activated.

---
 aleksis/core/static/js/progress.js        |  2 ++
 aleksis/core/templates/core/progress.html | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/aleksis/core/static/js/progress.js b/aleksis/core/static/js/progress.js
index 4c3e52c98..4d4c0692f 100644
--- a/aleksis/core/static/js/progress.js
+++ b/aleksis/core/static/js/progress.js
@@ -58,6 +58,8 @@ function customError(progressBarElement, progressBarMessageElement) {
 }
 
 $(document).ready(function () {
+    $("#progress-bar").removeClass("indeterminate").addClass("determinate");
+
     var progressUrl = Urls["celeryProgress:taskStatus"](OPTIONS.task_id);
     CeleryProgressBar.initProgressBar(progressUrl, {
         onProgress: customProgress,
diff --git a/aleksis/core/templates/core/progress.html b/aleksis/core/templates/core/progress.html
index 26d078d9f..6292fb0d2 100644
--- a/aleksis/core/templates/core/progress.html
+++ b/aleksis/core/templates/core/progress.html
@@ -13,13 +13,24 @@
   <div class="container">
     <div class="row">
       <div class="progress center">
-        <div class="determinate" style="width: 0;" id="progress-bar"></div>
+        <div class="indeterminate" style="width: 0;" id="progress-bar"></div>
       </div>
       <h6 class="center">
         {{ progress.title }}
       </h6>
     </div>
     <div class="row">
+      <noscript>
+        <div class="alert warning">
+          <p>
+            <i class="material-icons left">warning</i>
+            {% blocktrans %}
+              Without activated JavaScript the progress status can't be updated.
+            {% endblocktrans %}
+          </p>
+        </div>
+      </noscript>
+    
       <div id="messages"></div>
 
       <div id="result-box" style="display: none;">
-- 
GitLab