Fix: Teilen-Button und Telefonnummern-Links wieder hinzugefügt, Zeilenabstand in Suchergebnissen optimiert
This commit is contained in:
@@ -236,49 +236,43 @@
|
||||
|
||||
function displayResults(results) {
|
||||
const resultsDiv = document.getElementById('results');
|
||||
resultsDiv.innerHTML = '';
|
||||
const resultCount = document.getElementById('resultCount');
|
||||
|
||||
if (results.length === 0) {
|
||||
resultsDiv.innerHTML = '<p>Keine Ergebnisse gefunden.</p>';
|
||||
resultCount.textContent = '0 Ergebnisse';
|
||||
return;
|
||||
}
|
||||
|
||||
// Hole alle Suchbegriffe
|
||||
const searchTerms = {
|
||||
general: document.getElementById('q').value,
|
||||
name: document.getElementById('nameInput').value,
|
||||
ort: document.getElementById('ortInput').value,
|
||||
nummer: document.getElementById('nummerInput').value,
|
||||
plz: document.getElementById('plzInput').value,
|
||||
fachrichtung: document.getElementById('fachrichtungInput').value
|
||||
};
|
||||
resultCount.textContent = `${results.length} Ergebnisse`;
|
||||
|
||||
results.forEach(customer => {
|
||||
const card = document.createElement('div');
|
||||
card.className = 'customer-card';
|
||||
card.innerHTML = `
|
||||
<div class="customer-info">
|
||||
<h5 class="mb-1">${highlightText(customer.name, searchTerms.general || searchTerms.name)}</h5>
|
||||
<p class="mb-1 customer-number">${createCustomerLink(customer.nummer)}</p>
|
||||
<p class="mb-1">${createAddressLink(
|
||||
customer.strasse,
|
||||
highlightText(customer.plz, searchTerms.general || searchTerms.plz),
|
||||
highlightText(customer.ort, searchTerms.general || searchTerms.ort)
|
||||
)}</p>
|
||||
<p class="mb-1">Tel: ${createPhoneLink(customer.telefon)}</p>
|
||||
${customer.mobil ? `<p class="mb-1">Mobil: ${createPhoneLink(customer.mobil)}</p>` : ''}
|
||||
${customer.email ? `<p class="mb-1">E-Mail: ${createEmailLink(customer.email)}</p>` : ''}
|
||||
${customer.bemerkung ? `<p class="mb-1">Bemerkung: ${customer.bemerkung}</p>` : ''}
|
||||
${customer.fachrichtung ? `<p class="mb-1">Fachrichtung: ${highlightText(customer.fachrichtung, searchTerms.general || searchTerms.fachrichtung)}</p>` : ''}
|
||||
const resultsList = results.map(customer => `
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<h5 class="card-title">${customer.name}</h5>
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="copyCustomerLink('${customer.nummer}')">
|
||||
<i class="fas fa-share-alt"></i> Teilen
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<p><strong>Nummer:</strong> ${customer.nummer}</p>
|
||||
<p><strong>Adresse:</strong> ${customer.strasse}, ${customer.plz} ${customer.ort}</p>
|
||||
<p><strong>Telefon:</strong> ${createPhoneLink(customer.telefon)}</p>
|
||||
<p><strong>Mobil:</strong> ${createPhoneLink(customer.mobil)}</p>
|
||||
<p><strong>E-Mail:</strong> ${createEmailLink(customer.email)}</p>
|
||||
<p><strong>Fachrichtung:</strong> ${customer.fachrichtung}</p>
|
||||
${customer.tags && customer.tags.length > 0 ? `
|
||||
<p><strong>Tags:</strong>
|
||||
${customer.tags.map(tag => `<span class="badge bg-primary me-1">${tag}</span>`).join('')}
|
||||
</p>
|
||||
` : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
<button class="share-button" onclick="copyCustomerLink('${customer.nummer}')">
|
||||
<i class="fas fa-share-alt"></i> Teilen
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
resultsDiv.appendChild(card);
|
||||
});
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
resultsDiv.innerHTML = resultsList;
|
||||
}
|
||||
|
||||
function searchCustomers() {
|
||||
|
Reference in New Issue
Block a user