diff --git a/kontakt/index.html b/kontakt/index.html index 83330d8..3e01fde 100644 --- a/kontakt/index.html +++ b/kontakt/index.html @@ -269,37 +269,26 @@ .join(''); } - function formatContactCard(contact, searchQuery) { - const name = contact.name || 'Bez jména'; - const position = contact.position || ''; + function formatContactCard(contact, highlight = '') { + const highlightClass = highlight ? 'bg-yellow-100' : ''; - return `
-
-

${highlightText(name, searchQuery)}

+ // Phone display logic + let phoneDisplay = 'Bez telefonu'; + if (contact.phone || contact.service_phone || contact.phone_flap) { + phoneDisplay = [ + contact.phone ? `Tel: ${contact.phone}` : '', + contact.service_phone ? `Mobil: ${contact.service_phone}` : '', + contact.phone_flap ? `Klapka: ${contact.phone_flap}` : '' + ].filter(Boolean).join('
'); + } + + return ` +
+

${contact.name}

+

${contact.position || '—'}

+
${phoneDisplay}
- ${position ? `

${highlightText(position, searchQuery)}

` : ''} -
- ${contact.phone ? ` - - ` : ''} - ${contact.service_phone ? ` - - ` : ''} - ${!contact.phone && !contact.service_phone ? '

Bez telefonu

' : ''} -
-
`; + `; } function highlightText(text, query) {