<!DOCTYPE html>
<!--[if IE 8]><html class="ie8"><![endif]-->
<!--[if gt IE 8]><!--><html><!--<![endif]-->
  <head>
    <title>{{ title }}</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="{{ basepath }}/ui/css/admin.css" rel="stylesheet" media="screen, print">
    <script src="{{ basepath }}/ui/js/jquery.js"></script>
    <script src="{{ basepath }}/ui/js/bootstrap.js"></script>
    <script src="{{ basepath }}/ui/js/patternfly.js"></script>
    {% if newurl %}
    <script>
        $( document ).ready(
            function() {
                history.replaceState({} , document.title, "{{ newurl }}");
                $('[data-toggle="tooltip"]').tooltip();
            }
        );
    </script>
    {% endif %}
    {% block scripts %}
    {% endblock %}
  </head>
  <body>
    <nav class="navbar navbar-default navbar-pf" role="navigation">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".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="{{ basepath }}">
          <img src="{{ basepath }}/ui/img/brand.png" alt="Ipsilon" />
        </a>
      </div>
      <div class="collapse navbar-collapse navbar-collapse-1">
        <ul class="nav navbar-nav navbar-utility">
          <!-- <li>
            <a href="#">Status</a>
          </li> -->
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <span class="pficon pficon-user"></span>
              {{ user.fullname }} <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
              <li>
                <a href="{{ basepath }}/logout" id="logout">Log Out</a>
              </li>
            </ul>
          </li>
        </ul>
        <ul class="nav navbar-nav navbar-primary">
          {% for page in menu %}
          <li>
            <a href="{{ page.url }}">{{ page.title }}</a>
          </li>
          {% endfor %}
        </ul>
      </div>
    </nav>

    <div class="container">
      {% block main %}
      {% endblock %}
    </div>
  </body>
</html>
