From 71d811ea98795888efa51a8450dd796c0ba3b448 Mon Sep 17 00:00:00 2001 From: elpatron Date: Mon, 17 Mar 2025 20:41:16 +0100 Subject: [PATCH] =?UTF-8?q?Trefferz=C3=A4hler=20auf=20Gesamtzahl=20vereinf?= =?UTF-8?q?acht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/index.html | 43 ++++--------------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/templates/index.html b/templates/index.html index e505b93..b772f91 100644 --- a/templates/index.html +++ b/templates/index.html @@ -111,8 +111,7 @@ } .result-counts { display: flex; - flex-wrap: wrap; - gap: 1rem; + justify-content: center; margin-bottom: 1rem; padding: 0.5rem; background-color: #f8f9fa; @@ -172,10 +171,6 @@
- - - -
@@ -257,40 +252,10 @@ } function updateResultCounts() { - const name = document.getElementById('nameInput').value; - const ort = document.getElementById('ortInput').value; - const kundennummer = document.getElementById('kundennummerInput').value; - const fachrichtung = document.getElementById('fachrichtungInput').value; - const query = document.getElementById('searchInput').value; - - // Zähler für spezifische Felder - const nameCount = lastResults.filter(customer => - (customer.Vorname + ' ' + customer.Nachname).toLowerCase().includes(name.toLowerCase()) - ).length; - document.getElementById('nameCount').textContent = nameCount; - document.getElementById('nameCount').classList.toggle('visible', nameCount > 0); - - const ortCount = lastResults.filter(customer => - customer.Ort?.toLowerCase().includes(ort.toLowerCase()) - ).length; - document.getElementById('ortCount').textContent = ortCount; - document.getElementById('ortCount').classList.toggle('visible', ortCount > 0); - - const kundennummerCount = lastResults.filter(customer => - customer.Nummer?.toString().includes(kundennummer) - ).length; - document.getElementById('kundennummerCount').textContent = kundennummerCount; - document.getElementById('kundennummerCount').classList.toggle('visible', kundennummerCount > 0); - - const fachrichtungCount = lastResults.filter(customer => - customer.Fachrichtung?.toLowerCase().includes(fachrichtung.toLowerCase()) - ).length; - document.getElementById('fachrichtungCount').textContent = fachrichtungCount; - document.getElementById('fachrichtungCount').classList.toggle('visible', fachrichtungCount > 0); - - // Zähler für allgemeine Suche + // Nur Gesamtzahl anzeigen const generalCount = lastResults.length; - document.getElementById('generalCount').textContent = generalCount; + document.getElementById('generalCount').textContent = + generalCount > 0 ? `${generalCount} Treffer gefunden` : ''; document.getElementById('generalCount').classList.toggle('visible', generalCount > 0); }