diff --git a/web/app/static/js/nopaque/displays/CorpusDisplay.js b/web/app/static/js/nopaque/displays/CorpusDisplay.js index fb98e2bc..2050ed49 100644 --- a/web/app/static/js/nopaque/displays/CorpusDisplay.js +++ b/web/app/static/js/nopaque/displays/CorpusDisplay.js @@ -47,17 +47,24 @@ class CorpusDisplay extends RessourceDisplay { } setStatus(status) { - for (let element of this.displayElement.querySelectorAll('.corpus-status')) {this.setElement(element, status);} - for (let element of this.displayElement.querySelectorAll('.status')) {element.dataset.status = status;} - for (let element of this.displayElement.querySelectorAll('.status-spinner')) { - if (['complete', 'failed', 'unprepared'].includes(status)) { - element.classList.add('hide'); + for (let element of this.displayElement.querySelectorAll('.analyse-corpus-trigger')) { + if (['analysing', 'prepared', 'start analysis'].includes(status)) { + element.classList.remove('disabled'); } else { - element.classList.remove('hide'); + element.classList.add('disabled'); } } for (let element of this.displayElement.querySelectorAll('.build-corpus-trigger')) { - if (['complete', 'failed'].includes(status)) { + if (status === 'unprepared') { + element.classList.remove('disabled'); + } else { + element.classList.add('disabled'); + } + } + for (let element of this.displayElement.querySelectorAll('.corpus-status')) {this.setElement(element, status);} + for (let element of this.displayElement.querySelectorAll('.status')) {element.dataset.status = status;} + for (let element of this.displayElement.querySelectorAll('.status-spinner')) { + if (['submitted', 'queued', 'running', 'canceling', 'start analysis', 'stop analysis'].includes(status)) { element.classList.remove('hide'); } else { element.classList.add('hide'); diff --git a/web/app/templates/corpora/corpus.html.j2 b/web/app/templates/corpora/corpus.html.j2 index c6695603..7c1d5730 100644 --- a/web/app/templates/corpora/corpus.html.j2 +++ b/web/app/templates/corpora/corpus.html.j2 @@ -70,8 +70,8 @@
- searchAnalyze - buildBuild + searchAnalyze + buildBuild import_exportExport Corpus deleteDelete