Sunil Mohan Adapa 42d1225f5b
views: Use tags from menu or shortcut instead of the app
- Also remove the extra unwanted space between the tags.

- This allows different shortcuts of the same app to have different tags on the
home page. Example: email shortcuts on the home page.

- This also allows custom shortcuts to have their own tags without being
attached to any app provided by FreedomBox.

- Filter shown menu items by tags on the menu item rather than tags on the app.
They could be different.

Tests:

- Home page shows shortcuts with tags.

- Apps and system pages show shortcuts with apps.

- Apps are properly filtered when tags are clicked on in the app page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2025-01-09 21:09:23 +05:30

27 lines
741 B
HTML

{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% load static %}
<div class="card">
<a href="{{ item.url }}">
<div class="card-icon">
{% if 'fa-' in item.icon %}
<span class="fa {{ item.icon }}"></span>
{% else %}
{% if item.app_id %}
<img src="{% static item.app_id %}/icons/{{ item.icon }}.svg"/>
{% else %}
<img src="{% static 'theme/icons/' %}{{ item.icon }}.svg"/>
{% endif %}
{% endif %}
</div>
<div class="card-title">{{ item.name }}</div>
<div class="card-tags">
{% for tag in item.tags|slice:":3" %}{% trans tag %}{% if not forloop.last %}・{% endif %}{% endfor %}
</div>
</a>
</div>