navbar.html 2.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
<!-- load in go templatetags -->
{% load go_extras %}

<header class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary" role="navigation">
    <div class="container">
        <!-- Brand -->
        <a class="navbar-brand" href="/">
            <i class="fas fa-link"></i> Go
        </a>

        <!-- Collapse button -->
        <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#collapse" aria-controls="collapse" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
        </button>

        <!--  -->
        <div class="collapse navbar-collapse" id="collapse">
            <!--  -->
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="{% url 'about' %}">About</a>
                </li>        
                <!--  -->
                {% if user.is_authenticated %}
                    {% if user.registereduser.approved %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'new_link' %}">New Link</a>
                        </li>
                    {% endif %}
                    {% if not user.registereduser.registered %}
                        <li class="nav-item">
                            <a href="{% url 'signup' %}">Register</a>
                        </li>
                    {% endif %}
                {% endif %}
            </ul>
            <!--  -->
            <ul class="navbar-nav ml-auto">
                <!--  -->
                {% if user.is_authenticated %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'go_logout' %}">
                            Log Out <i class="fa fa-sign-out fa-fw"></i>
                        </a>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'go_login' %}">
David Haynes's avatar
David Haynes committed
49
                            <i class="fas fa-sign-in-alt"></i> Log In
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
                        </a>
                    </li>
                {% endif %}
                <!--  -->
                {% if user.is_staff %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'useradmin' %}">
                            User Moderation <i class="fa fa-users fa-fw"></i>
                        </a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </div>
</header>