Fix broken images and improve match highlighting consistency

- Hide broken external provider images with onerror fallback
- Make source keyword text green when any match is detected
- All matched fields (name, MPN, SPN, or any source keyword) show green text
This commit is contained in:
Sebastian Almberg 2026-03-12 09:41:46 +01:00
parent 49b97fc077
commit e70aa0ea19

View file

@ -216,8 +216,11 @@
{% set isTopResult = loop.first %}
<tr{% if isTopResult and not isCompleted %} class="table-success"{% endif %}>
<td>
<img src="{{ dto.preview_image_url }}" data-thumbnail="{{ dto.preview_image_url }}"
class="hoverpic" style="max-width: 35px;" {{ stimulus_controller('elements/hoverpic') }}>
{% if dto.preview_image_url %}
<img src="{{ dto.preview_image_url }}" data-thumbnail="{{ dto.preview_image_url }}"
class="hoverpic" style="max-width: 35px;" {{ stimulus_controller('elements/hoverpic') }}
onerror="this.style.display='none'">
{% endif %}
</td>
<td>
{# Check for matches against source keyword (what was searched) #}
@ -257,7 +260,7 @@
<span class="badge bg-info">{{ result.sourceField ?? 'unknown' }}</span>
{% endif %}
{% if result.sourceKeyword %}
<br><small>{{ result.sourceKeyword }}</small>
<br><small{% if anyMatch %} class="fw-bold text-success"{% endif %}>{{ result.sourceKeyword }}</small>
{% endif %}
</td>
<td>