<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
  
    http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

{% extends 'admin/base.html' %}
{% block head_css %}
  {{ super() }}
  <link href="{{ url_for('static', filename='bootstrap-theme.css') }}" rel="stylesheet">
  <link rel="icon" type="image/png" href="{{ url_for("static", filename="pin_30.png") }}">
  <link rel="stylesheet" type="text/css" href="{{ url_for("static", filename="main.css") }}">
{% endblock %}

{% block tail_js %}
{{ super() }}
<script src="{{ url_for('static', filename='jqClock.min.js') }}" type="text/javascript"></script>
<script>
    x = new Date()
    var UTCseconds = (x.getTime() + x.getTimezoneOffset()*60*1000);
    $("#clock").clock({
        "seconds":"false",
        "calendar":"false",
        "format":"24",
        "timestamp":UTCseconds
    }).click(function(){
        alert('{{ hostname }}');
    });
    $('span').tooltip();
</script>
{% endblock %}

{% block page_body %}
<div class="container">

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#admin-navbar-collapse">
          <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" rel="home" href="{{ url_for('admin.index') }}" style="cursor: pointer;">
              <img style="float: left; width:35px; margin-top: -7px;"
                   src="{{ url_for("static", filename="pin_100.png") }}"
                   title="{{ current_user.username }}">
              <span>Airflow</span>
          </a>
      </div>
      <!-- navbar content -->
      <div class="collapse navbar-collapse" id="admin-navbar-collapse">
        {% block main_menu %}
        <ul class="nav navbar-nav">
          {{ layout.menu() }}
        </ul>
        {% endblock %}

        {% block menu_links %}
        <ul class="nav navbar-right">
          {{ layout.menu_links() }}
        </ul>
        {% endblock %}
        <!-- clock and logout -->
        <ul class="nav navbar-nav navbar-right">
            <li><a id="clock"></a></li>
            {% if current_user.is_authenticated %}
              <li><a href="{{ url_for('airflow.logout') }}"><span data-toggle="tooltip" data-placement="left" title="Logout" class="glyphicon glyphicon-off"></span></a></li>
            {% endif %}
        </ul>
          <ul class="nav navbar-nav navbar-right">
              <li><a id="clock"></a></li>
          </ul>
      </div>
      </div>
</nav>
  {% block messages %}
  {{ layout.messages() }}
  {% endblock %}

  {# store the jinja2 context for form_rules rendering logic #}
  {% set render_ctx = h.resolve_ctx() %}
  {% block body %}
    {{ content }}
  {% endblock %}

</div>
{% endblock %}

