{% extends 'maccman/_head.html' %}

{% load bootstrap3 %}

{% block body %}

<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
  <div class="container">

    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{% url 'maccman:index' %}">{% block brand %}{{brand.super}}{% endblock %}</a>
    </div>

    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        {% if user.is_authenticated and user.userprofile %}
        <li>
          <a href="{% url 'maccman:logout' %}">Logout</a>
        </li>
        {% else %}
        <li>
          <a href="{% url 'maccman:login' %}">Login</a>
        </li>
        {% endif %}

        {% if user.is_authenticated and user.userprofile %}
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">Profile <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="{% url 'maccman:domains' %}">Domains</a></li>
            <li><a href="{% url 'maccman:mailboxes' %}">Mailboxes</a></li>
          </ul>
        </li>
        {% endif %}
      </ul>
    </div>

  </div>
</nav>

<div class="container">

  <div class="row">
    <div class="col-md-12">
      {% block content %}{% endblock %}
    </div>
  </div>

</div>

{% bootstrap_javascript jquery=1 %}

{% endblock %}
