From e46f0032bdb0818dc6691e98a18c4c85447d9004 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Mon, 17 Jul 2023 12:35:53 +0200
Subject: [PATCH] Show static visualizations only on overview page
---
app/static/js/CorpusAnalysis/CorpusAnalysisApp.js | 2 +-
app/templates/corpora/analysis.html.j2 | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js b/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js
index b7e860bd..2d69fed7 100644
--- a/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js
+++ b/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js
@@ -63,7 +63,7 @@ class CorpusAnalysisApp {
// Initialize extensions
for (const extension of Object.values(this.extensions)) {
- statusTextElement.innerHTML += `
Initializing extension ${extension.name}...`;
+ statusTextElement.innerHTML += `
Initializing ${extension.name} extension...`;
await extension.init();
statusTextElement.innerText += ' Done'
}
diff --git a/app/templates/corpora/analysis.html.j2 b/app/templates/corpora/analysis.html.j2
index bb9e4e68..6fd1c510 100644
--- a/app/templates/corpora/analysis.html.j2
+++ b/app/templates/corpora/analysis.html.j2
@@ -2,7 +2,7 @@
{% import "materialize/wtf.html.j2" as wtf %}
{% import 'corpora/_analysis/concordance.html.j2' as concordance_extension %}
{% import 'corpora/_analysis/reader.html.j2' as reader_extension %}
-{% import 'corpora/_analysis/static_visualization.html.j2' as static_visualization_extension%}
+{% import 'corpora/_analysis/static_visualization.html.j2' as static_visualization_extension %}
{% set extensions = [concordance_extension, reader_extension, static_visualization_extension] %}
{% block main_attribs %} class="service-scheme" data-service="corpus-analysis" id="corpus-analysis-app-container"{% endblock main_attribs %}
@@ -32,10 +32,12 @@
{% endfor %}
+
+ {{ static_visualization_extension.container_content }}
-{% for extension in extensions %}
+{% for extension in extensions if extension.name != 'Static Visualization' %}
{{ extension.container_content }}