navigation.html 2.5 KB
Newer Older
David Haynes's avatar
David Haynes committed
1
<!-- load in go templatetags -->
2
{% load go_extras %}
David Haynes's avatar
David Haynes committed
3 4

<!-- define our navbar -->
5
<div class="navbar navbar-default">
David Haynes's avatar
David Haynes committed
6 7 8 9 10 11 12 13 14 15 16
    <!-- define the main "header" of the navbar -->
    <div class="navbar-header" style="margin-left:5%;">
        <!-- responsive hamburger menu -->
        <button type="button" class="navbar-toggle" data-toggle="collapse"
        data-target=".navbar-responsive-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <!-- Go brand logo -->
        <a class="navbar-brand" href="{% url 'index' %}">
17
            <i class="fa fa-link"></i> Go
David Haynes's avatar
David Haynes committed
18 19 20 21 22 23 24
        </a>
    </div>

    <!-- define the parts of the navbar that collapse b/c responsiveness -->
    <div class="navbar-collapse collapse navbar-responsive-collapse">
        <!-- The left side -->
        <ul class="nav navbar-nav navbar-left">
25
            <li><a href="{% url 'about' %}" data-jslicense="1">About</a></li>
David Haynes's avatar
David Haynes committed
26 27 28
            <!-- only show if the current user is authenticated -->
            {% if user.is_authenticated %}
                <!-- only if they are an approved user -->
Zac Wood's avatar
Zac Wood committed
29
                <li><a href="{% url 'new_link' %}">New Link</a></li>
David Haynes's avatar
David Haynes committed
30
            {% endif %}
31
        </ul>
David Haynes's avatar
David Haynes committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

        <!-- The right side -->
        <ul class="nav navbar-nav navbar-right" style="margin-right:5%;">
            <!-- only show if the user is authenticated -->
            {% if user.is_authenticated %}
                <!-- logout -->
                <li>
                    <a href="{% url 'go_logout' %}">
                        Log Out <i class="fa fa-sign-out fa-fw"></i>
                    </a>
                </li>
            {% else %}
                <!-- login -->
                <li>
                    <a href="{% url 'go_login' %}">
                        Log In <i class="fa fa-sign-in fa-fw"></i>
                    </a>
                </li>
            {% endif %}

            <!-- if the user is a staff member -->
            {% if user.is_staff %}
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle"
                    data-toggle="dropdown">
                    Administration <i class="fa fa-caret-down fa-fw"></i></a>
                    <ul class="dropdown-menu dropdown-menu-left">
                        <li><a href="{% url 'useradmin' %}">User Moderation <i class="fa fa-users fa-fw"></i></a></li>
                    </ul>
                </li>
            {% endif %}
        </ul>
    </div>
65
</div>