Skip to content

Commit 56ebc2b

Browse files
Only show dropdown if more then one item.
1 parent 2b5b8ac commit 56ebc2b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

dashboards/templates/dashboards/dashboard.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@
2222
<ul class="menu">
2323
{% for section, items in sections.items %}
2424
<li class="{% if section == active_section %}active{% endif %}">
25-
<a href="#">{{ section }}</a>
26-
<ul class="dropdown">
27-
{% for item in items %}
28-
<li class="{% if item.selected %}active{% endif %}">
29-
<a href="{{ item.url }}">{{ item.title }}</a>
30-
</li>
31-
{% endfor %}
32-
</ul>
25+
{% if items|length > 1 %}
26+
<a href="#">{{ section }}</a>
27+
<ul class="dropdown">
28+
{% for item in items %}
29+
<li class="{% if item.selected %}active{% endif %}">
30+
<a href="{{ item.url }}">{{ item.title }}</a>
31+
</li>
32+
{% endfor %}
33+
</ul>
34+
{% else %}
35+
<a href="{{ items.0.url }}">{{ section }}</a>
36+
{% endif %}
3337
</li>
3438
{% endfor %}
3539
<li>

0 commit comments

Comments
 (0)