From 1dc7d2a1c67b49e6d3f3d5feceb1eb7d41fb8d9f Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Tue, 8 Aug 2023 16:00:05 +0200 Subject: [PATCH] remove prefix stuff --- .../js/CorpusAnalysis/CorpusAnalysisApp.js | 8 +-- .../CorpusAnalysisConcordance.js | 22 +++---- .../js/CorpusAnalysis/CorpusAnalysisReader.js | 14 ++-- .../corpora/_analysis/concordance.html.j2 | 42 ++++++------ .../corpora/_analysis/reader.html.j2 | 20 +++--- app/templates/corpora/analysis.html.j2 | 65 ++++++++++--------- 6 files changed, 86 insertions(+), 85 deletions(-) diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js b/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js index d6274f32..c182019b 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisApp.js @@ -6,10 +6,10 @@ class CorpusAnalysisApp { // HTML elements this.elements = { - container: document.querySelector('#corpus-analysis-app-container'), - extensionCards: document.querySelector('#corpus-analysis-app-extension-cards'), - extensionTabs: document.querySelector('#corpus-analysis-app-extension-tabs'), - initModal: document.querySelector('#corpus-analysis-app-init-modal') + container: document.querySelector('#corpus-analysis-container'), + extensionCards: document.querySelector('#corpus-analysis-extension-cards'), + extensionTabs: document.querySelector('#corpus-analysis-extension-tabs'), + initModal: document.querySelector('#corpus-analysis-init-modal') }; // Materialize elements this.elements.m = { diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js index b199e399..2348f7f2 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js @@ -1,22 +1,22 @@ class CorpusAnalysisConcordance { name = 'Concordance'; - constructor(app, idPrefix) { + constructor(app) { this.app = app; this.data = {}; this.elements = { - container: document.querySelector(`#${idPrefix}-container`), - error: document.querySelector(`#${idPrefix}-error`), - userInterfaceForm: document.querySelector(`#${idPrefix}-user-interface-form`), - form: document.querySelector(`#${idPrefix}-form`), - progress: document.querySelector(`#${idPrefix}-progress`), - subcorpusInfo: document.querySelector(`#${idPrefix}-subcorpus-info`), - subcorpusActions: document.querySelector(`#${idPrefix}-subcorpus-actions`), - subcorpusItems: document.querySelector(`#${idPrefix}-subcorpus-items`), - subcorpusList: document.querySelector(`#${idPrefix}-subcorpus-list`), - subcorpusPagination: document.querySelector(`#${idPrefix}-subcorpus-pagination`) + container: document.querySelector(`#corpus-analysis-concordance-container`), + error: document.querySelector(`#corpus-analysis-concordance-error`), + userInterfaceForm: document.querySelector(`#corpus-analysis-concordance-user-interface-form`), + form: document.querySelector(`#corpus-analysis-concordance-form`), + progress: document.querySelector(`#corpus-analysis-concordance-progress`), + subcorpusInfo: document.querySelector(`#corpus-analysis-concordance-subcorpus-info`), + subcorpusActions: document.querySelector(`#corpus-analysis-concordance-subcorpus-actions`), + subcorpusItems: document.querySelector(`#corpus-analysis-concordance-subcorpus-items`), + subcorpusList: document.querySelector(`#corpus-analysis-concordance-subcorpus-list`), + subcorpusPagination: document.querySelector(`#corpus-analysis-concordance-subcorpus-pagination`) }; this.settings = { diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js b/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js index 4990b91a..2a231ce2 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisReader.js @@ -1,18 +1,18 @@ class CorpusAnalysisReader { name = 'Reader'; - constructor(app, idPrefix) { + constructor(app) { this.app = app; this.data = {}; this.elements = { - container: document.querySelector(`#${idPrefix}-container`), - corpus: document.querySelector(`#${idPrefix}-corpus`), - corpusPagination: document.querySelector(`#${idPrefix}-corpus-pagination`), - error: document.querySelector(`#${idPrefix}-error`), - progress: document.querySelector(`#${idPrefix}-progress`), - userInterfaceForm: document.querySelector(`#${idPrefix}-user-interface-form`) + container: document.querySelector(`#corpus-analysis-reader-container`), + corpus: document.querySelector(`#corpus-analysis-reader-corpus`), + corpusPagination: document.querySelector(`#corpus-analysis-reader-corpus-pagination`), + error: document.querySelector(`#corpus-analysis-reader-error`), + progress: document.querySelector(`#corpus-analysis-reader-progress`), + userInterfaceForm: document.querySelector(`#corpus-analysis-reader-user-interface-form`) }; this.settings = { diff --git a/app/templates/corpora/_analysis/concordance.html.j2 b/app/templates/corpora/_analysis/concordance.html.j2 index 1eb1da18..95bcb944 100644 --- a/app/templates/corpora/_analysis/concordance.html.j2 +++ b/app/templates/corpora/_analysis/concordance.html.j2 @@ -13,7 +13,7 @@ {# The extension container content #} -{% macro container_content(id_prefix) %} +{% macro container_content() %}
@@ -23,34 +23,34 @@
-
- {{ expert_mode.card_content(id_prefix) }} +
+ {{ expert_mode.card_content() }}
-
- {{ query_builder.card_content(id_prefix) }} +
+ {{ query_builder.card_content() }}
-
+
Results


-
+
-
+
@@ -99,8 +99,8 @@
-

-
+

+
@@ -113,27 +113,27 @@ - +
-
    +
      {% endmacro %} {# The extension modals #} -{% macro modals(id_prefix) %} -{{ query_builder.structural_attribute_modal(id_prefix) }} -{{ query_builder.positional_attribute_modal(id_prefix) }} +{% macro modals() %} +{{ query_builder.structural_attribute_modal() }} +{{ query_builder.positional_attribute_modal() }} {% endmacro %} {# The extension scripts #} -{% macro scripts(id_prefix) %} +{% macro scripts() %} {% endmacro %} diff --git a/app/templates/corpora/analysis.html.j2 b/app/templates/corpora/analysis.html.j2 index 261eb226..f4282518 100644 --- a/app/templates/corpora/analysis.html.j2 +++ b/app/templates/corpora/analysis.html.j2 @@ -4,58 +4,59 @@ {% import 'corpora/_analysis/reader.html.j2' as reader_extension %} {% import 'corpora/_analysis/static_visualization.html.j2' as static_visualization_extension %} -{% set extensions = - { - 'corpus-analysis-app-concordance-extension': concordance_extension, - 'corpus-analysis-app-reader-extension': reader_extension, - 'corpus-analysis-app-static-visualizations-extension': static_visualization_extension - } -%} - -{% block main_attribs %} class="service-scheme" data-service="corpus-analysis" id="corpus-analysis-app-container"{% endblock main_attribs %} +{% block main_attribs %} class="service-scheme" data-service="corpus-analysis" id="corpus-analysis-container"{% endblock main_attribs %} {% block page_content %} -
        -
      • Corpus analysis
      • - {% for id, extension in extensions.items() if extension.name != 'Static Visualization (beta)' %} + -
        +

        {{ title }}

        -
        - {% for id, extension in extensions.items() if extension.name != 'Static Visualization (beta)' %} +
        -
        +
        - {{ extension.name }} -

        {{ extension.description }}

        + {{ concordance_extension.name }} +

        {{ concordance_extension.description }}

        +
        +
        +
        +
        +
        +
        + {{ reader_extension.name }} +

        {{ reader_extension.description }}

        - {% endfor %}
        - {{ static_visualization_extension.container_content('corpus-analysis-app-static-visualizations-extension') }} + {{ static_visualization_extension.container_content() }}
        -{% for id, extension in extensions.items() if extension.name != 'Static Visualization (beta)' %} -
        - {{ extension.container_content(id) }} +{% for extension in extensions if extension.name != 'Static Visualization (beta)' %} +
        + {{ extension.container_content() }}
        {% endfor %} {% endblock page_content %} {% block modals %} {{ super() }} -