Commit c0b9d983 authored by BERJON Matthieu's avatar BERJON Matthieu
Browse files

Add of active links in header

I added a type of macro in the header template in order to get an active
link on the current page.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <>
parent 4413e026
{% if request.resolver_match.url_name == link_name %}
class="nav-item active"
{% endif %}
......@@ -7,24 +7,24 @@
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<li {% include 'macros/active_link.html' with link_name='webapp_list' %}>
<a class="nav-link" href="{% url 'main:webapp_list' %}"><i class="fas fa-cloud"></i> apps</a>
<li class="nav-item">
<li {# TODO: put active link if possible #}>
<a class="nav-link" href="#"><i class="fas fa-book"></i> Docs</a>
{% if not user.is_authenticated %}
<li class="nav-item">
<li {% include 'macros/active_link.html' with link_name='account_login' %}>
<a class="nav-link" href="{% url 'account_login' %}"><i class="fas fa-sign-in-alt"></i> Login</a>
<li class="nav-item">
<li {% include 'macros/active_link.html' with link_name='account_signup' %}>
<a class="nav-link" href="{% url 'account_signup' %}"><i class="fas fa-user-plus"></i> Sign up</a>
{% else %}
<li class="nav-item">
<li {% include 'macros/active_link.html' with link_name='job_list' %}>
<a class="nav-link" href="{% url 'main:job_list' %}"><i class="fas fa-database"></i> My jobs</a>
<li class="nav-item">
<li {% include 'macros/active_link.html' with link_name='account_logout' %}>
<a class="nav-link" href="{% url 'account_logout' %}"><i class="fas fa-sign-out-alt"></i> Sign out</a>
{% endif %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment