Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/unfold/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ def get_sidebar_list(self, request: HttpRequest) -> list[dict[str, Any]]:

for group in copy.deepcopy(navigation):
group["items"] = self._get_navigation_items(request, group["items"], tabs)

# Badge callbacks
if "badge" in group and isinstance(group["badge"], str):
try:
callback = import_string(group["badge"])
group["badge_callback"] = lazy(callback)(request)
except ImportError:
pass

results.append(group)

return results
Expand Down
2 changes: 2 additions & 0 deletions src/unfold/templates/unfold/helpers/app_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<h2 class="font-semibold flex flex-row group items-center mb-1 mx-3 py-1.5 px-3 select-none text-font-important-light text-sm dark:text-font-important-dark {% if group.collapsible %}cursor-pointer hover:text-primary-600 dark:hover:text-primary-500{% endif %}" {% if group.collapsible %}x-on:click="navigationOpen = !navigationOpen"{% endif %}>
{{ group.title }}

{% include "unfold/helpers/app_list_badge.html" with item=group %}

{% if group.collapsible %}
<span class="material-symbols-outlined ml-auto transition-all group-hover:text-primary-600 dark:group-hover:text-primary-500" x-bind:class="{'rotate-90': navigationOpen}">
chevron_right
Expand Down