mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 15:12:12 +00:00
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:
parent
49b97fc077
commit
e70aa0ea19
1 changed files with 6 additions and 3 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue