mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 09:05:30 +00:00
kl. updates
This commit is contained in:
@@ -293,7 +293,7 @@ class j extends HTMLElement {
|
|||||||
<div class="ml-2 flex flex-col gap-y-2 mt-2 whitespace-nowrap">
|
<div class="ml-2 flex flex-col gap-y-2 mt-2 whitespace-nowrap">
|
||||||
<a href="/">Jahrgängen</a>
|
<a href="/">Jahrgängen</a>
|
||||||
<a href="/akteure/a">Personen & Werken</a>
|
<a href="/akteure/a">Personen & Werken</a>
|
||||||
<a href="/kategorie/">Betragsarten</a>
|
<a href="/kategorie/">Beitragsarten</a>
|
||||||
<a href="/ort/">Orten</a>
|
<a href="/ort/">Orten</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
<div class="py-3 mx-auto bg-slate-50 w-full border-t-8 border-slate-600 ">
|
<div class="py-3 mx-auto bg-slate-50 w-full border-t-8 border-slate-600 ">
|
||||||
<header class="mx-auto w-fit mt-12">
|
<header class="mx-auto w-fit mt-12">
|
||||||
<a href="/" class="no-underline">
|
<a href="/" class="no-underline">
|
||||||
<h1 class="text-2xl">Königsberger gelehrte und politische Zeitungen</h1>
|
<h1 class="text-2xl">Königsbergsche Gelehrte und Politische Zeitungen</h1>
|
||||||
</a>
|
</a>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<h1 class="text-4xl font-bold text-gray-900 mb-2">Autor:innen</h1>
|
<h1 class="text-4xl font-bold text-gray-900 mb-2">Autor:innen</h1>
|
||||||
<p class="text-gray-700">Personen, die Beiträge in der Zeitung verfasst haben</p>
|
<p class="text-gray-700">Personen, die Beiträge in der Zeitung verfasst haben</p>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<h1 class="text-4xl font-bold text-gray-900 mb-2">Personen & Körperschaften</h1>
|
<h1 class="text-4xl font-bold text-gray-900 mb-2">Personen</h1>
|
||||||
<p class="text-gray-700">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
|
<p class="text-gray-700">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
@@ -22,4 +22,4 @@
|
|||||||
<span class="ml-2 text-gray-700">Nur Autor:innen anzeigen</span>
|
<span class="ml-2 text-gray-700">Nur Autor:innen anzeigen</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<title>
|
<title>
|
||||||
KGPZ – Personen & Körperschaften: {{ Upper .model.Search }}
|
KGPZ – Personen: {{ Upper .model.Search }}
|
||||||
</title>
|
</title>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
{{ range $_, $w := $works }}
|
{{ range $_, $w := $works }}
|
||||||
<div class="mb-2 break-inside-avoid max-w-[95ch]">
|
<div class="mb-2 break-inside-avoid max-w-[95ch]">
|
||||||
{{- if ne (len $w.Item.Citation.InnerXML ) 0 -}}
|
{{- if ne (len $w.Item.Citation.InnerXML ) 0 -}}
|
||||||
<div class="indent-6">
|
<div class="ml-4 -indent-4">
|
||||||
{{- /* Get other associated persons for this work */ -}}
|
{{- /* Get other associated persons for this work */ -}}
|
||||||
{{- $otherAuthors := slice -}}
|
{{- $otherAuthors := slice -}}
|
||||||
{{- $otherTranslators := slice -}}
|
{{- $otherTranslators := slice -}}
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
{{- $categoryFlags := GetCategoryFlags $p.Item -}}
|
{{- $categoryFlags := GetCategoryFlags $p.Item -}}
|
||||||
{{- $categories := slice -}}
|
{{- $categories := slice -}}
|
||||||
{{- if $categoryFlags.Rezension -}}
|
{{- if $categoryFlags.Rezension -}}
|
||||||
{{- $categories = append $categories "Rezension" -}}
|
{{- $categories = append $categories "Rezensiert" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if $categoryFlags.Auszug -}}
|
{{- if $categoryFlags.Auszug -}}
|
||||||
{{- $categories = append $categories "Auszug" -}}
|
{{- $categories = append $categories "Auszug" -}}
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
|
|
||||||
{{- /* Display each group */ -}}
|
{{- /* Display each group */ -}}
|
||||||
{{- range $groupKey, $groupPieces := $pieceGroups -}}
|
{{- range $groupKey, $groupPieces := $pieceGroups -}}
|
||||||
<div class="mb-1 text-gray-600">
|
<div class="ml-4 mb-1 text-gray-600">
|
||||||
{{- /* Extract categories, authors, translators, and editors from group key */ -}}
|
{{- /* Extract categories, authors, translators, and editors from group key */ -}}
|
||||||
{{- $keyParts := split $groupKey "|" -}}
|
{{- $keyParts := split $groupKey "|" -}}
|
||||||
{{- $categoryName := index $keyParts 0 -}}
|
{{- $categoryName := index $keyParts 0 -}}
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
{{- /* Use plural if multiple pieces grouped together */ -}}
|
{{- /* Use plural if multiple pieces grouped together */ -}}
|
||||||
{{- $displayCategory := $categoryName -}}
|
{{- $displayCategory := $categoryName -}}
|
||||||
{{- if gt (len $groupPieces) 1 -}}
|
{{- if gt (len $groupPieces) 1 -}}
|
||||||
{{- if eq $categoryName "Rezension" -}}
|
{{- if eq $categoryName "Rezensiert" -}}
|
||||||
{{- $displayCategory = "Rezensionen" -}}
|
{{- $displayCategory = "Rezensionen" -}}
|
||||||
{{- else if eq $categoryName "Auszug" -}}
|
{{- else if eq $categoryName "Auszug" -}}
|
||||||
{{- $displayCategory = "Auszüge" -}}
|
{{- $displayCategory = "Auszüge" -}}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<h2 class="text-2xl font-bold font-serif text-gray-900 mb-1">Autor:innen</h2>
|
<h2 class="text-2xl font-bold font-serif text-gray-900 mb-1">Autor:innen</h2>
|
||||||
<p class="text-base text-gray-600 mb-3">Personen, die Beiträge in der Zeitung verfasst haben</p>
|
<p class="text-base text-gray-600 mb-3">Personen, die Beiträge in der Zeitung verfasst haben</p>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<h2 class="text-2xl font-bold font-serif text-gray-900 mb-1">Personen & Körperschaften</h2>
|
<h2 class="text-2xl font-bold font-serif text-gray-900 mb-1">Personen</h2>
|
||||||
<p class="text-base text-gray-600 mb-3">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
|
<p class="text-base text-gray-600 mb-3">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ class NavigationMenu extends HTMLElement {
|
|||||||
<div class="ml-2 flex flex-col gap-y-2 mt-2 whitespace-nowrap">
|
<div class="ml-2 flex flex-col gap-y-2 mt-2 whitespace-nowrap">
|
||||||
<a href="/">Jahrgängen</a>
|
<a href="/">Jahrgängen</a>
|
||||||
<a href="/akteure/a">Personen & Werken</a>
|
<a href="/akteure/a">Personen & Werken</a>
|
||||||
<a href="/kategorie/">Betragsarten</a>
|
<a href="/kategorie/">Beitragsarten</a>
|
||||||
<a href="/ort/">Orten</a>
|
<a href="/ort/">Orten</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -813,9 +813,9 @@ class SearchBar extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupEventListeners() {
|
setupEventListeners() {
|
||||||
const searchInput = this.querySelector('#search');
|
const searchInput = this.querySelector("#search");
|
||||||
const resetButton = this.querySelector('#search-reset');
|
const resetButton = this.querySelector("#search-reset");
|
||||||
const loadingIndicator = this.querySelector('#search-loading');
|
const loadingIndicator = this.querySelector("#search-loading");
|
||||||
|
|
||||||
if (!searchInput || !resetButton) return;
|
if (!searchInput || !resetButton) return;
|
||||||
|
|
||||||
@@ -824,10 +824,10 @@ class SearchBar extends HTMLElement {
|
|||||||
|
|
||||||
// Function to toggle reset button visibility
|
// Function to toggle reset button visibility
|
||||||
const toggleResetButton = () => {
|
const toggleResetButton = () => {
|
||||||
if (searchInput.value.trim() !== '') {
|
if (searchInput.value.trim() !== "") {
|
||||||
resetButton.classList.remove('hidden');
|
resetButton.classList.remove("hidden");
|
||||||
} else {
|
} else {
|
||||||
resetButton.classList.add('hidden');
|
resetButton.classList.add("hidden");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -835,16 +835,16 @@ class SearchBar extends HTMLElement {
|
|||||||
toggleResetButton();
|
toggleResetButton();
|
||||||
|
|
||||||
// Show/hide reset button as user types
|
// Show/hide reset button as user types
|
||||||
searchInput.addEventListener('input', toggleResetButton);
|
searchInput.addEventListener("input", toggleResetButton);
|
||||||
|
|
||||||
// Handle reset button click
|
// Handle reset button click
|
||||||
resetButton.addEventListener('click', () => {
|
resetButton.addEventListener("click", () => {
|
||||||
searchInput.value = '';
|
searchInput.value = "";
|
||||||
resetButton.classList.add('hidden');
|
resetButton.classList.add("hidden");
|
||||||
|
|
||||||
// Trigger the same HTMX behavior that happens when manually clearing the field
|
// Trigger the same HTMX behavior that happens when manually clearing the field
|
||||||
// This will automatically navigate back to the previous page
|
// This will automatically navigate back to the previous page
|
||||||
searchInput.dispatchEvent(new Event('input', { bubbles: true }));
|
searchInput.dispatchEvent(new Event("input", { bubbles: true }));
|
||||||
|
|
||||||
// Focus back on search input
|
// Focus back on search input
|
||||||
searchInput.focus();
|
searchInput.focus();
|
||||||
@@ -855,42 +855,42 @@ class SearchBar extends HTMLElement {
|
|||||||
// Hide reset button when loading starts
|
// Hide reset button when loading starts
|
||||||
const beforeRequestHandler = (event) => {
|
const beforeRequestHandler = (event) => {
|
||||||
if (event.detail.elt === searchInput) {
|
if (event.detail.elt === searchInput) {
|
||||||
resetButton.style.display = 'none';
|
resetButton.style.display = "none";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Show reset button when loading ends (if there's still text)
|
// Show reset button when loading ends (if there's still text)
|
||||||
const afterRequestHandler = (event) => {
|
const afterRequestHandler = (event) => {
|
||||||
if (event.detail.elt === searchInput) {
|
if (event.detail.elt === searchInput) {
|
||||||
resetButton.style.display = '';
|
resetButton.style.display = "";
|
||||||
toggleResetButton();
|
toggleResetButton();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
document.body.addEventListener('htmx:beforeRequest', beforeRequestHandler);
|
document.body.addEventListener("htmx:beforeRequest", beforeRequestHandler);
|
||||||
document.body.addEventListener('htmx:afterRequest', afterRequestHandler);
|
document.body.addEventListener("htmx:afterRequest", afterRequestHandler);
|
||||||
|
|
||||||
// Store references for cleanup
|
// Store references for cleanup
|
||||||
this.htmxRequestListeners.push(
|
this.htmxRequestListeners.push(
|
||||||
{ event: 'htmx:beforeRequest', handler: beforeRequestHandler },
|
{ event: "htmx:beforeRequest", handler: beforeRequestHandler },
|
||||||
{ event: 'htmx:afterRequest', handler: afterRequestHandler }
|
{ event: "htmx:afterRequest", handler: afterRequestHandler },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simple click listener to clear search when any link is clicked
|
// Simple click listener to clear search when any link is clicked
|
||||||
this.linkClickHandler = (event) => {
|
this.linkClickHandler = (event) => {
|
||||||
const clickedElement = event.target;
|
const clickedElement = event.target;
|
||||||
const link = clickedElement.closest('a[href]');
|
const link = clickedElement.closest("a[href]");
|
||||||
|
|
||||||
// If a link was clicked and it has an href, clear the search
|
// If a link was clicked and it has an href, clear the search
|
||||||
if (link && link.getAttribute('href') && searchInput.value.trim() !== '') {
|
if (link && link.getAttribute("href") && searchInput.value.trim() !== "") {
|
||||||
searchInput.value = '';
|
searchInput.value = "";
|
||||||
resetButton.classList.add('hidden');
|
resetButton.classList.add("hidden");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Listen for clicks on the entire document
|
// Listen for clicks on the entire document
|
||||||
document.addEventListener('click', this.linkClickHandler);
|
document.addEventListener("click", this.linkClickHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
@@ -902,7 +902,7 @@ class SearchBar extends HTMLElement {
|
|||||||
|
|
||||||
// Remove link click listener
|
// Remove link click listener
|
||||||
if (this.linkClickHandler) {
|
if (this.linkClickHandler) {
|
||||||
document.removeEventListener('click', this.linkClickHandler);
|
document.removeEventListener("click", this.linkClickHandler);
|
||||||
this.linkClickHandler = null;
|
this.linkClickHandler = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user