Skip to content

Commit b867180

Browse files
committed
Highlight active navbar items
Signed-off-by: Keshav Priyadarshi <[email protected]>
1 parent b4da07b commit b867180

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fedcode/templates/navbar.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<div class="navbar-menu">
88
<div class="navbar-start">
99
{% if user.person %}
10-
<a class="navbar-item" href="{% url 'home-page' %}">
10+
<a class="navbar-item {% if request.path == '/' %}is-active{% endif %}" href="{% url 'home-page' %}">
1111
My Packages
1212
</a>
1313
{% endif %}
14-
<a class="navbar-item" href="{% url 'purl-list' %}">
14+
<a class="navbar-item {% if request.path == '/purl-list' %}is-active{% endif %}" href="{% url 'purl-list' %}">
1515
All Packages
1616
</a>
1717
<a class="navbar-item" href="https://federatedcode.readthedocs.io/en/latest/" target="_blank">
@@ -42,9 +42,16 @@
4242
</div>
4343

4444
<div class="navbar-dropdown is-right mr-2">
45+
{% if request.path == '/users/@'|add:user.username %}
46+
<a class="navbar-item is-active-light" href="{% url 'user-profile' user.username %}"
47+
style="background-color: #dcdcdc;">
48+
<strong>Profile</strong>
49+
</a>
50+
{% else %}
4551
<a class="navbar-item" href="{% url 'user-profile' user.username %}">
4652
<strong>Profile</strong>
4753
</a>
54+
{% endif %}
4855
<a class="navbar-item has-text-danger" href="{% url 'logout' %}">
4956
<strong>Log out</strong>
5057
</a>

0 commit comments

Comments
 (0)