+ ${outerKey.replace(/_/g, " ")}
+ | `
+ }
if (outerKey === "corpus_all_texts" || outerKey === "text_lookup") {
html += `
`
diff --git a/web/app/templates/corpora/analyse_corpus.html.j2 b/web/app/templates/corpora/analyse_corpus.html.j2
index f3ad7959..61132d65 100644
--- a/web/app/templates/corpora/analyse_corpus.html.j2
+++ b/web/app/templates/corpora/analyse_corpus.html.j2
@@ -59,7 +59,6 @@
{% include 'modals/show_metadata.html.j2' %}
-{% include 'modals/show_text_details.html.j2' %}
{% include 'modals/analysis_init.html.j2' %}
{% include 'modals/export_query_results.html.j2' %}
{% include 'modals/context_modal.html.j2' %}
@@ -187,7 +186,6 @@ document.addEventListener("DOMContentLoaded", () => {
listenForMetaData,
listenForViewNotification,
listenForResults]);
- console.log(client.eventListeners);
// Load the listeners so that they will be executed if triggered
client.loadSocketEventListeners();
/**
diff --git a/web/app/templates/interactions/scroll_to_top.html.j2 b/web/app/templates/interactions/scroll_to_top.html.j2
index 4e1c4971..69caae7e 100644
--- a/web/app/templates/interactions/scroll_to_top.html.j2
+++ b/web/app/templates/interactions/scroll_to_top.html.j2
@@ -1,4 +1,3 @@
-
- {% if query_metadata is defined %}
-
- {{ Macros.show_metadata(query_metadata) }}
-
- {% else %}
- {% endif %}
diff --git a/web/app/templates/query_results/inspect.html.j2 b/web/app/templates/query_results/inspect.html.j2
index 9bc800c6..998dbba6 100644
--- a/web/app/templates/query_results/inspect.html.j2
+++ b/web/app/templates/query_results/inspect.html.j2
@@ -40,6 +40,7 @@
{% include 'interactions/analysis.html.j2' %}
{% include 'interactions/cite.html.j2' %}
+ {# Hide those because they are not needed when inspecting results #}
{% include 'interactions/export.html.j2' %}
{% include 'interactions/create.html.j2' %}
@@ -54,7 +55,6 @@
{% include 'modals/show_metadata.html.j2' %}
-{% include 'modals/show_text_details.html.j2' %}
{% include 'modals/context_modal.html.j2' %}
@@ -122,7 +122,9 @@ document.addEventListener("DOMContentLoaded", () => {
let resultsList = new ResultsList('result-list', ResultsList.options);
// Import results data from json file.
const resultsJson = {{ query_result_file_content|tojson|safe }};
- /**
+ // Import metadata from DB passed to this view
+ const metaDataJson = {{ query_metadata|tojson|safe }};
+ /**
* Register needed listeners and their callbacks. But we will
* just call the attached callbacks manually. Because dynamicMode is false.
*/
@@ -159,14 +161,19 @@ document.addEventListener("DOMContentLoaded", () => {
'#display-options-form-result_context',
'#display-options-form-results_per_page',
'#full-results-create',
+ '#inspect-results-export',
'#meta-data-modal-content',
'#meta-data-modal',
'#query-results-table',
'#show-meta-data',
'#sub-results-create',
]);
+ // Hide buttons which are not needed when just inspecting results
+ resultsList.inspectResultsExport.classList.add('hide');
// Execute client event listener callbacks manually because dynamicMode is false
client.eventListeners['corpus_analysis_query'].executeCallbacks([resultsJson])
+ // Save meta data to results after the init callback from line above
+ results.metaData = metaDataJson;
client.eventListeners['corpus_analysis_query_results'].executeCallbacks([resultsJson])
/**
* The following listener handles what functions are called when the user
diff --git a/web/app/templates/query_results/inspect.html.j2.bak b/web/app/templates/query_results/inspect.html.j2.bak
deleted file mode 100644
index 85f954da..00000000
--- a/web/app/templates/query_results/inspect.html.j2.bak
+++ /dev/null
@@ -1,233 +0,0 @@
-{% extends "nopaque.html.j2" %}
-
-{% set headline = ' ' %}
-
-{% set full_width = True %}
-{% set imported = True %}
-
-{% block page_content %}
-
-
-
-
-
-
-
-
- {% include 'interactions/infos.html.j2' %}
- {% include 'interactions/display.html.j2' %}
- {% include 'interactions/analysis.html.j2' %}
- {% include 'interactions/cite.html.j2' %}
-
- {% include 'tables/query_results.html.j2' %}
-
-
-
-
-
-{% include 'interactions/scroll_to_top.html.j2' %}
-
-
-{% include 'modals/show_metadata.html.j2' %}
-{% include 'modals/show_text_details.html.j2' %}
-{% include 'modals/context_modal.html.j2' %}
-
-
-
-
-
-
-{% endblock %}
diff --git a/web/app/templates/utils/macros.html.j2 b/web/app/templates/utils/macros.html.j2
index 07766e4d..54fa671d 100644
--- a/web/app/templates/utils/macros.html.j2
+++ b/web/app/templates/utils/macros.html.j2
@@ -35,78 +35,3 @@
main .tabs .indicator {background-color: {{ hex_color }};}
{%- endmacro -%}
-
-{% macro show_metadata(query_metadata) %}
-
-
-
-
-
- Metadata Description |
- Value |
-
-
-
- {% for pair in query_metadata|dictsort %}
-
- {{ pair[0]|replace("_", " ")|upper() }} |
- {% if pair[0] == "corpus_all_texts"
- or pair[0] == "text_lookup" %}
-
-
- {% for key, value in pair[1].items() %}
- -
-
-
-
- {% endfor %}
-
- |
- {% else %}
- {{ pair[1] }} |
- {% endif %}
-
- {% endfor %}
-
-
-
-
-
-{% endmacro %}
|