@@ -1028,74 +1028,58 @@ class ResultsList extends List {
`
for (let [outerKey, outerValue] of Object.entries(metaDataObject)) {
- table += `
- ${outerKey} | `
+ html += `
+ ${outerKey.replace(/_/g, " ")} | `
if (outerKey === "corpus_all_texts" || outerKey === "text_lookup") {
- table += `
- `
+ html += `
+ | `
} else {
- table += `${outerValue} | `
+ html += `${outerValue} | `
}
- table += `
`
+ html += ``
}
- table += `
+ html += `
`
- return table
+ return html
}
// Creates the text details for the texts shown in the corpus analysis metadata modal.
createTextDetails(metaDataObject) {
- let modal = document.getElementById("modal-text-details");
- modal = M.Modal.init(modal, {"dismissible": true});
- modal.open();
let metadataKey = event.target.dataset.metadataKey;
let textKey = event.target.dataset.textKey;
let textData = metaDataObject[metadataKey][textKey];
- let bibliographicData = document.getElementById("bibliographic-data");
+ let bibliographicData = document.getElementById(`bibliographic-data-${metadataKey}-${textKey}`);
bibliographicData.innerHTML = "";
- let table = document.createElement("table");
for (let [key, value] of Object.entries(textData)) {
- table.insertAdjacentHTML("afterbegin",
+ bibliographicData.insertAdjacentHTML("afterbegin",
`
-
- ${key} |
- ${value} |
-
+
${key}: ${value}
`);
}
- table.insertAdjacentHTML("afterbegin",
- `
-
- Description |
- Value |
-
- `)
- bibliographicData.appendChild(table);
}
}
diff --git a/web/app/templates/corpora/analyse_corpus.html.j2 b/web/app/templates/corpora/analyse_corpus.html.j2
index a6c272a7..97e2cd2d 100644
--- a/web/app/templates/corpora/analyse_corpus.html.j2
+++ b/web/app/templates/corpora/analyse_corpus.html.j2
@@ -325,10 +325,11 @@
let table = results.jsList.createMetaDataForModal(metaDataObject);
metaDataModalContent.insertAdjacentHTML("afterbegin", table);
metaDataModal.open();
- var moreTextDetailsButtons;
- moreTextDetailsButtons = document.getElementsByClassName("more-text-detials");
- for (var btn of moreTextDetailsButtons) {
- btn.onclick = () => {
+ let collapsibles = document.getElementsByClassName("text-metadata");
+ for (let collapsible of collapsibles) {
+ collapsible.onclick = () => {
+ let elems = document.querySelectorAll('.collapsible');
+ let instances = M.Collapsible.init(elems, {accordion: false});
results.jsList.createTextDetails(metaDataObject);
}
}
diff --git a/web/app/templates/interactions/cite.html.j2 b/web/app/templates/interactions/cite.html.j2
index 31274310..c6d96b6c 100644
--- a/web/app/templates/interactions/cite.html.j2
+++ b/web/app/templates/interactions/cite.html.j2
@@ -9,7 +9,8 @@
class="waves-effect
waves-light
btn-flat
- disabled"
+ disabled
+ flat-interaction"
type="submit">Action One
cloud
@@ -19,7 +20,8 @@
class="waves-effect
waves-light
btn-flat
- disabled"
+ disabled
+ flat-interaction"
type="submit">Action Two
add
diff --git a/web/app/templates/macros/query_result_macro.html.j2 b/web/app/templates/macros/query_result_macro.html.j2
index 49eb06b4..68bf0903 100644
--- a/web/app/templates/macros/query_result_macro.html.j2
+++ b/web/app/templates/macros/query_result_macro.html.j2
@@ -4,42 +4,41 @@
- Metadata Description |
- Value |
+ Metadata Description |
+ Value |
{% for pair in query_metadata|dictsort %}
- {{ pair[0] }} |
+ {{ pair[0]|replace("_", " ")|upper() }} |
{% if pair[0] == "corpus_all_texts"
or pair[0] == "text_lookup" %}
-
+ data-text-key="{{ key }}">
+ info_outline
+ {{ value['author'] }} - {{ value['publishing_year'] }}
+ - {{ value['title'] }}
+
+
+
+ {% endfor %}
+
|
{% else %}
{{ pair[1] }} |
@@ -50,49 +49,25 @@