diff --git a/app/templates/corpora/corpus.html.j2 b/app/templates/corpora/corpus.html.j2 index 3e0effb7..16c9231c 100644 --- a/app/templates/corpora/corpus.html.j2 +++ b/app/templates/corpora/corpus.html.j2 @@ -4,7 +4,7 @@

{{ corpus.title }}

{{ corpus.description }}

-
+
@@ -17,7 +17,7 @@
- +
@@ -34,9 +34,9 @@
- helpAnalyse + searchAnalyze {% if corpus.files[0] is defined %} - whatshotBuild Corpus + buildBuild {% endif %} deleteDelete
@@ -160,24 +160,31 @@ } setStatus(status) { - let analyseBtn, progressIndicator, statusElement; + let analyzeElement, buildElement, progressIndicatorElement, statusElement; - if (status != "preparable" && status != "preparing") { - progressIndicator = document.getElementById("progress-indicator"); - progressIndicator.classList.add("hide"); + progressIndicatorElement = document.getElementById("progress-indicator"); + if (["queued", "running", "start analysis"].includes(status)) { + progressIndicatorElement.classList.remove("hide"); + } else { + progressIndicatorElement.classList.add("hide"); } + statusElement = document.getElementById("status"); statusElement.dataset.status = status; - analyseBtn = document.getElementById('analyse'); - if (status === 'prepared' || status === 'analysing' || status === 'failed') { - analyseBtn.classList.remove('hide', 'disabled'); - } else if (status === 'start analysis' || status === 'stop analysis') { - analyseBtn.classList.remove('hide'); - analyseBtn.classList.add('disabled'); + statusElement.classList.remove("hide"); + + analyzeElement = document.getElementById("analyze"); + if (["analysing", "prepared", "start analysis"].includes(status)) { + analyzeElement.classList.remove("disabled", "hide"); + } else { + analyzeElement.classList.add("disabled", "hide"); } + + buildElement = document.getElementById("build"); if (status === 'unprepared') { - var prepareBtn = document.getElementById('prepare'); - prepareBtn.classList.remove('hide'); + buildElement.classList.remove("disabled", "hide"); + } else { + buildElement.classList.add("disabled", "hide"); } } }