Skip to content

Commit

Permalink
Fix django#354, add logic to detect currently active navigation itme
Browse files Browse the repository at this point in the history
  • Loading branch information
relekang committed Apr 9, 2015
1 parent 052c15f commit 6d02978
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions djangoproject/templates/includes/header.html
@@ -1,32 +1,31 @@

<div role="banner" id="top">
<div class="container">
<a class="logo" href="{% url 'homepage' %}">Django</a>
<p class="meta">The web framework for perfectionists with deadlines.</p>
<div role="navigation">
<ul>
<li{% if section == 'overview' %} class="active"{% endif %}>
<li{% if 'start' in request.path %} class="active"{% endif %}>
<a href="{% url 'overview' %}">Overview</a>
</li>
<li{% if section == 'download' %} class="active"{% endif %}>
<li{% if 'download' in request.path %} class="active"{% endif %}>
<a href="{% url 'download' %}">Download</a>
</li>
<li{% if section == 'docs' %} class="active"{% endif %}>
<li{% if request.host.name == 'docs' %} class="active"{% endif %}>
<a href="{% block doc_url %}{% url 'homepage' host 'docs' %}{% endblock %}">Documentation</a>
</li>
<li{% if section == 'news' %} class="active"{% endif %}>
<li{% if 'weblog' in request.path %} class="active"{% endif %}>
<a href="{% url 'weblog:index' %}">News</a>
</li>
<li{% if section == 'community' %} class="active"{% endif %}>
<li{% if 'community' in request.path or 'conduct' in request.path %} class="active"{% endif %}>
<a href="{% url 'community-index' %}">Community</a>
</li>
<li{% if section == 'code' %} class="active"{% endif %}>
<li>
<a href="https://code.djangoproject.com/">Code</a>
</li>
<li{% if section == 'about' %} class="active"{% endif %}>
<li{% if 'foundation' in request.path %} class="active"{% endif %}>
<a href="{% url 'homepage' %}foundation/">About</a>
</li>
<li{% if section == 'fundraising' %} class="active"{% endif %}>
<li{% if 'fundraising' in request.path %} class="active"{% endif %}>
<a href="{% url 'fundraising:index' %}">&#9829; Donate</a>
</li>
</ul>
Expand Down

0 comments on commit 6d02978

Please sign in to comment.