Skip to content

Commit

Permalink
Fix issue with childless categories in primary nav
Browse files Browse the repository at this point in the history
Their links were not clickable previously.
  • Loading branch information
codeinthehole committed Apr 16, 2013
1 parent 0c3d43d commit c70f55f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions sites/demo/templates/partials/nav_primary.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
<li><a tabindex="-1" href="{% url catalogue:index %}">{% trans "All" %}</a></li>
{% for category in categories %}
<li class="dropdown">
<a tabindex="-1" href="{{ category.0.get_absolute_url }}" data-toggle="dropdown" class="dropdown-toggle">{{ category.0.name }} {% if category.1 %}<i class="icon-arrow-down"></i>{% endif %}</a>
{% if category.1 %}
<ul class="dropdown-menu">
{% for subcategory in category.1 %}
<li><a tabindex="-1" href="{{ subcategory.0.get_absolute_url }}"> {{ subcategory.0.name }} <i class="icon-arrow-right"></i></a></li>
{% endfor %}
<li class="divider"></li>
<li><a tabindex="-1" href="{{ category.0.get_absolute_url }}">All {{ category.0.name }} <i class="icon-arrow-right"></i></a></li>
</ul>
<a tabindex="-1" href="{{ category.0.get_absolute_url }}" data-toggle="dropdown" class="dropdown-toggle">{{ category.0.name }} {% if category.1 %}<i class="icon-arrow-down"></i>{% endif %}</a>
<ul class="dropdown-menu">
{% for subcategory in category.1 %}
<li><a tabindex="-1" href="{{ subcategory.0.get_absolute_url }}"> {{ subcategory.0.name }} <i class="icon-arrow-right"></i></a></li>
{% endfor %}
<li class="divider"></li>
<li><a tabindex="-1" href="{{ category.0.get_absolute_url }}">All {{ category.0.name }} <i class="icon-arrow-right"></i></a></li>
</ul>
{% else %}
<a tabindex="-1" href="{{ category.0.get_absolute_url }}">{{ category.0.name }}</a>
{% endif %}
</li>
{% endfor %}
Expand Down

0 comments on commit c70f55f

Please sign in to comment.