Skip to content

Commit

Permalink
fix: empty menu items (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jan 15, 2024
1 parent 3a10c02 commit a126d71
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions src/unfold/templates/unfold/helpers/app_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,42 @@
{% if sidebar_navigation %}
<div class="overflow-auto">
{% for group in sidebar_navigation %}
{% if group.separator %}
<hr class="border-t border-gray-200 mx-6 my-2 dark:border-gray-800" />
{% endif %}

{% if group.title %}
<h3 class="font-medium my-3 px-6 text-gray-900 text-sm first:mt-0 dark:text-gray-200">
{{ group.title }}
</h3>
{% endif %}
{% if group.items %}
{% if group.separator %}
<hr class="border-t border-gray-200 mx-6 my-2 dark:border-gray-800" />
{% endif %}

<ol class="px-6">
{% for item in group.items %}
<li>
<a href="{{ item.link }}"
class="border border-transparent flex h-11 items-center -mx-3 px-3 py-2 rounded-md {% if item.active %}bg-gray-100 font-semibold text-primary-600 dark:border dark:border-gray-800 dark:bg-white/[.02] dark:text-primary-500{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200{% endif %}">
{% if item.icon %}
<span class="material-symbols-outlined md-18 mr-3 w-4.5">
{{ item.icon }}
</span>
{% endif %}
{% if group.title %}
<h3 class="font-medium my-3 px-6 text-gray-900 text-sm first:mt-0 dark:text-gray-200">
{{ group.title }}
</h3>
{% endif %}

<span class="text-sm">
{{ item.title|safe }}
</span>
<ol class="px-6">
{% for item in group.items %}
<li>
<a href="{{ item.link }}"
class="border border-transparent flex h-11 items-center -mx-3 px-3 py-2 rounded-md {% if item.active %}bg-gray-100 font-semibold text-primary-600 dark:border dark:border-gray-800 dark:bg-white/[.02] dark:text-primary-500{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-400 hover:dark:text-gray-200{% endif %}">
{% if item.icon %}
<span class="material-symbols-outlined md-18 mr-3 w-4.5">
{{ item.icon }}
</span>
{% endif %}

{% if item.badge %}
<span class="bg-red-600 font-semibold ml-2 px-1 rounded-sm text-xs text-white">
{{ item.badge|safe }}
<span class="text-sm">
{{ item.title|safe }}
</span>
{% endif %}
</a>
</li>
{% endfor %}
</ol>

{% if item.badge %}
<span class="bg-red-600 font-semibold ml-2 px-1 rounded-sm text-xs text-white">
{{ item.badge|safe }}
</span>
{% endif %}
</a>
</li>
{% endfor %}
</ol>
{% endif %}
{% endfor %}
</div>

Expand Down

0 comments on commit a126d71

Please sign in to comment.