From 1bb265b7f4807fd5607cff2cef4fba0a1a68c914 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Fri, 11 Sep 2020 15:53:30 +0200 Subject: [PATCH] Add show corpus metadata function to result inspect. --- .../corpus_analysis/view/ResultsView.js | 18 +- .../templates/corpora/analyse_corpus.html.j2 | 2 - .../interactions/scroll_to_top.html.j2 | 1 - .../templates/modals/show_metadata.html.j2 | 6 - .../templates/query_results/inspect.html.j2 | 11 +- .../query_results/inspect.html.j2.bak | 233 ------------------ web/app/templates/utils/macros.html.j2 | 75 ------ 7 files changed, 25 insertions(+), 321 deletions(-) delete mode 100644 web/app/templates/query_results/inspect.html.j2.bak diff --git a/web/app/static/js/modules/corpus_analysis/view/ResultsView.js b/web/app/static/js/modules/corpus_analysis/view/ResultsView.js index e2afbf74..cffdd1b1 100644 --- a/web/app/static/js/modules/corpus_analysis/view/ResultsView.js +++ b/web/app/static/js/modules/corpus_analysis/view/ResultsView.js @@ -792,8 +792,22 @@ class ResultsList extends List { ` for (let [outerKey, outerValue] of Object.entries(metaDataObject)) { - html += ` - ${outerKey.replace(/_/g, " ")}` + // Use more descriptive names + if (outerKey === 'corpus_all_texts') { + let tmpName = 'All texts in this corpus'; + html += ` + ${tmpName.replace(/_/g, " ")} + ` + } else if (outerKey === 'text_lookup') { + let tmpName = 'Texts where the query resulted in matches' + html += ` + ${tmpName.replace(/_/g, " ")} + ` + } else { + html += ` + ${outerKey.replace(/_/g, " ")} + ` + } if (outerKey === "corpus_all_texts" || outerKey === "text_lookup") { html += `