{#
 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 'appbuilder/init.html' %}
{% import 'appbuilder/baselib.html' as baselib %}

{% block head_css %}
  {{ super() }}


  {% if not appbuilder.app_theme %}
    {# airflowDefaultTheme.css file contains the styles from local bootstrap-theme.css #}
    <link href="{{ url_for_asset('airflowDefaultTheme.css') }}" rel="stylesheet">
  {% endif %}
  <link href="{{ url_for_asset('main.css') }}" rel="stylesheet">

  <link rel="icon" type="image/png" href="{{ url_for('static', filename='pin_32.png') }}">
{% endblock %}


{% block body %}
    {% include 'appbuilder/general/confirm.html' %}
    {% include 'appbuilder/general/alert.html' %}
    {% block navbar %}
        <header class="top" role="header">
        {% include 'appbuilder/navbar.html' %}
        </header>
    {% endblock %}


    <div class="container">
      <div class="row">
          {% block messages %}
            {% include 'appbuilder/flash.html' %}
            {% if scheduler_job is defined and (not scheduler_job or not scheduler_job.is_alive()) %}
              <div class="alert alert-warning">
                <p>The scheduler does not appear to be running.
                {% if scheduler_job %}
                Last heartbeat was received <time title="{{ scheduler_job.latest_heartbeat.isoformat() }}" datetime="{{ scheduler_job.latest_heartbeat.isoformat() }}">{{ macros.datetime_diff_for_humans(scheduler_job.latest_heartbeat) }}</time>.
                {% endif %}
                </p>
                <p>The DAGs list may not update, and new tasks will not be scheduled.</p>
              </div>
            {% endif %}
          {% endblock %}
          {% block content %}
          {% endblock %}
      </div>
    </div>

    {% block footer %}
        <footer>
        <div class="img-rounded nav-fixed-bottom">
            <div class="container">
                {% include 'appbuilder/footer.html' %}
            </div>
        </div>
        </footer>
    {% endblock %}
{% endblock %}


{% block tail_js %}
  {{ super() }}

  <script type="text/javascript">
    // below variables are used in base.js
    var hostName = '{{ hostname }}';
    var csrfToken = '{{ csrf_token() }}';
    $("time[title]").tooltip()
  </script>
  <!--[if IE ]>
  <script src="{{ url_for_asset('ie.js') }}" type="text/javascript"></script>
  <![endif]-->
  <script src="{{ url_for_asset('base.js') }}" type="text/javascript"></script>

  {% if analytics_tool is defined and analytics_tool %}
    {% include "analytics/" + analytics_tool + ".html" %}
  {% endif %}
{% endblock %}
