mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
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>
This commit is contained in:
parent
ffc95019f0
commit
42d1225f5b
@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div class="card-title">{{ item.name }}</div>
|
||||
<div class="card-tags">
|
||||
{% for tag in item.app.info.tags|slice:":3" %}{% trans tag %}{% if not forloop.last %}・{% endif %}{% endfor %}
|
||||
{% for tag in item.tags|slice:":3" %}{% trans tag %}{% if not forloop.last %}・{% endif %}{% endfor %}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -76,9 +76,7 @@
|
||||
{{ shortcut.name }}
|
||||
</div>
|
||||
<div class="card-tags">
|
||||
{% for tag in shortcut.app.info.tags|slice:":3" %}
|
||||
{% trans tag %}{% if not forloop.last %}・{% endif %}
|
||||
{% endfor %}
|
||||
{% for tag in shortcut.tags|slice:":3" %}{% trans tag %}{% if not forloop.last %}・{% endif %}{% endfor %}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -191,7 +191,7 @@ class AppsIndexView(TemplateView):
|
||||
A mismatch is when a selected tag is *not* present in the list of
|
||||
tags for menu item.
|
||||
"""
|
||||
menu_tags = set(menu_item.app.info.tags)
|
||||
menu_tags = set(menu_item.tags)
|
||||
return [tag not in menu_tags for tag in selected_tags]
|
||||
|
||||
def _sort_key(menu_item):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user