index: Generalize showing custom shortcut icons

Instead of detecting 'custom' in the name of the icons (which can happen if the
icon basename itself contains the word 'custom'), check if the icon is already
an absolute URL path.

Tests:

- Add a custom shortcut and provide a custom icon for it in
/var/www/plinth/custom/static/icons/. Visit the frontpage and ensure that the
icon is visible.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-09-17 16:24:48 -07:00 committed by James Valleroy
parent ced83a31e9
commit 729690792f
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -62,7 +62,7 @@
<a href="{{ shortcut.url }}">
{% endif %}
<div class="card-icon">
{% if "custom" in shortcut.icon %}
{% if shortcut.icon|first == "/" %}
<img src="{{ shortcut.icon }}"/>
{% else %}
{% if shortcut.app_id %}