Features: 1) Enhance quick links rendering with flexible class styling;

Fixes: 1) Fix inconsistent indentation and formatting in quick links construction;

Extra: 1) Add class attribute to navigation component for layout control; 2) Improve readability by using consistent block structure.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-11-16 16:11:14 +03:00
parent b305876feb
commit d139b7daf6
2 changed files with 8 additions and 6 deletions

View file

@ -104,7 +104,7 @@
{% trans "Quick Links" %} {% trans "Quick Links" %}
{% endcomponent %} {% endcomponent %}
{% if quick_links %} {% if quick_links %}
{% component "unfold/components/navigation.html" with items=quick_links %} {% component "unfold/components/navigation.html" with class="flex flex-col gap-1" items=quick_links %}
{% endcomponent %} {% endcomponent %}
{% else %} {% else %}
{% component "unfold/components/text.html" %} {% component "unfold/components/text.html" %}

View file

@ -430,11 +430,13 @@ def dashboard_callback(request, context):
link = item.get("link") link = item.get("link")
if not title or not link: if not title or not link:
continue continue
quick_links.append({ quick_links.append(
"title": str(title), {
"link": str(link), "title": str(title),
**({"icon": item.get("icon")} if item.get("icon") else {}), "link": str(link),
}) **({"icon": item.get("icon")} if item.get("icon") else {}),
}
)
most_wished: dict[str, str | int | float | None] | None = None most_wished: dict[str, str | int | float | None] | None = None
with suppress(Exception): with suppress(Exception):