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">
|
||||
<a href="/">Jahrgängen</a>
|
||||
<a href="/akteure/a">Personen & Werken</a>
|
||||
<a href="/kategorie/">Betragsarten</a>
|
||||
<a href="/kategorie/">Beitragsarten</a>
|
||||
<a href="/ort/">Orten</a>
|
||||
</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 ">
|
||||
<header class="mx-auto w-fit mt-12">
|
||||
<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>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
{{ 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>
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<title>
|
||||
KGPZ – Personen & Körperschaften: {{ Upper .model.Search }}
|
||||
KGPZ – Personen: {{ Upper .model.Search }}
|
||||
</title>
|
||||
@@ -20,7 +20,7 @@
|
||||
{{ range $_, $w := $works }}
|
||||
<div class="mb-2 break-inside-avoid max-w-[95ch]">
|
||||
{{- 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 */ -}}
|
||||
{{- $otherAuthors := slice -}}
|
||||
{{- $otherTranslators := slice -}}
|
||||
@@ -100,7 +100,7 @@
|
||||
{{- $categoryFlags := GetCategoryFlags $p.Item -}}
|
||||
{{- $categories := slice -}}
|
||||
{{- if $categoryFlags.Rezension -}}
|
||||
{{- $categories = append $categories "Rezension" -}}
|
||||
{{- $categories = append $categories "Rezensiert" -}}
|
||||
{{- end -}}
|
||||
{{- if $categoryFlags.Auszug -}}
|
||||
{{- $categories = append $categories "Auszug" -}}
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
{{- /* Display each group */ -}}
|
||||
{{- 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 */ -}}
|
||||
{{- $keyParts := split $groupKey "|" -}}
|
||||
{{- $categoryName := index $keyParts 0 -}}
|
||||
@@ -185,7 +185,7 @@
|
||||
{{- /* Use plural if multiple pieces grouped together */ -}}
|
||||
{{- $displayCategory := $categoryName -}}
|
||||
{{- if gt (len $groupPieces) 1 -}}
|
||||
{{- if eq $categoryName "Rezension" -}}
|
||||
{{- if eq $categoryName "Rezensiert" -}}
|
||||
{{- $displayCategory = "Rezensionen" -}}
|
||||
{{- else if eq $categoryName "Auszug" -}}
|
||||
{{- $displayCategory = "Auszüge" -}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<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>
|
||||
{{ 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>
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ class NavigationMenu extends HTMLElement {
|
||||
<div class="ml-2 flex flex-col gap-y-2 mt-2 whitespace-nowrap">
|
||||
<a href="/">Jahrgängen</a>
|
||||
<a href="/akteure/a">Personen & Werken</a>
|
||||
<a href="/kategorie/">Betragsarten</a>
|
||||
<a href="/kategorie/">Beitragsarten</a>
|
||||
<a href="/ort/">Orten</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -813,9 +813,9 @@ class SearchBar extends HTMLElement {
|
||||
}
|
||||
|
||||
setupEventListeners() {
|
||||
const searchInput = this.querySelector('#search');
|
||||
const resetButton = this.querySelector('#search-reset');
|
||||
const loadingIndicator = this.querySelector('#search-loading');
|
||||
const searchInput = this.querySelector("#search");
|
||||
const resetButton = this.querySelector("#search-reset");
|
||||
const loadingIndicator = this.querySelector("#search-loading");
|
||||
|
||||
if (!searchInput || !resetButton) return;
|
||||
|
||||
@@ -824,10 +824,10 @@ class SearchBar extends HTMLElement {
|
||||
|
||||
// Function to toggle reset button visibility
|
||||
const toggleResetButton = () => {
|
||||
if (searchInput.value.trim() !== '') {
|
||||
resetButton.classList.remove('hidden');
|
||||
if (searchInput.value.trim() !== "") {
|
||||
resetButton.classList.remove("hidden");
|
||||
} else {
|
||||
resetButton.classList.add('hidden');
|
||||
resetButton.classList.add("hidden");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -835,16 +835,16 @@ class SearchBar extends HTMLElement {
|
||||
toggleResetButton();
|
||||
|
||||
// Show/hide reset button as user types
|
||||
searchInput.addEventListener('input', toggleResetButton);
|
||||
searchInput.addEventListener("input", toggleResetButton);
|
||||
|
||||
// Handle reset button click
|
||||
resetButton.addEventListener('click', () => {
|
||||
searchInput.value = '';
|
||||
resetButton.classList.add('hidden');
|
||||
resetButton.addEventListener("click", () => {
|
||||
searchInput.value = "";
|
||||
resetButton.classList.add("hidden");
|
||||
|
||||
// Trigger the same HTMX behavior that happens when manually clearing the field
|
||||
// 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
|
||||
searchInput.focus();
|
||||
@@ -855,42 +855,42 @@ class SearchBar extends HTMLElement {
|
||||
// Hide reset button when loading starts
|
||||
const beforeRequestHandler = (event) => {
|
||||
if (event.detail.elt === searchInput) {
|
||||
resetButton.style.display = 'none';
|
||||
resetButton.style.display = "none";
|
||||
}
|
||||
};
|
||||
|
||||
// Show reset button when loading ends (if there's still text)
|
||||
const afterRequestHandler = (event) => {
|
||||
if (event.detail.elt === searchInput) {
|
||||
resetButton.style.display = '';
|
||||
resetButton.style.display = "";
|
||||
toggleResetButton();
|
||||
}
|
||||
};
|
||||
|
||||
document.body.addEventListener('htmx:beforeRequest', beforeRequestHandler);
|
||||
document.body.addEventListener('htmx:afterRequest', afterRequestHandler);
|
||||
document.body.addEventListener("htmx:beforeRequest", beforeRequestHandler);
|
||||
document.body.addEventListener("htmx:afterRequest", afterRequestHandler);
|
||||
|
||||
// Store references for cleanup
|
||||
this.htmxRequestListeners.push(
|
||||
{ event: 'htmx:beforeRequest', handler: beforeRequestHandler },
|
||||
{ event: 'htmx:afterRequest', handler: afterRequestHandler }
|
||||
{ event: "htmx:beforeRequest", handler: beforeRequestHandler },
|
||||
{ event: "htmx:afterRequest", handler: afterRequestHandler },
|
||||
);
|
||||
}
|
||||
|
||||
// Simple click listener to clear search when any link is clicked
|
||||
this.linkClickHandler = (event) => {
|
||||
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 (link && link.getAttribute('href') && searchInput.value.trim() !== '') {
|
||||
searchInput.value = '';
|
||||
resetButton.classList.add('hidden');
|
||||
if (link && link.getAttribute("href") && searchInput.value.trim() !== "") {
|
||||
searchInput.value = "";
|
||||
resetButton.classList.add("hidden");
|
||||
}
|
||||
};
|
||||
|
||||
// Listen for clicks on the entire document
|
||||
document.addEventListener('click', this.linkClickHandler);
|
||||
document.addEventListener("click", this.linkClickHandler);
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
@@ -902,7 +902,7 @@ class SearchBar extends HTMLElement {
|
||||
|
||||
// Remove link click listener
|
||||
if (this.linkClickHandler) {
|
||||
document.removeEventListener('click', this.linkClickHandler);
|
||||
document.removeEventListener("click", this.linkClickHandler);
|
||||
this.linkClickHandler = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user