{#
 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/baselayout.html' %}
{% from 'airflow/_messages.html' import show_message %}

{% block page_title -%}
  Airflow
{% endblock %}

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

  {% if not appbuilder.app_theme %}
    {# airflowDefaultTheme.css file contains the styles from local bootstrap-theme.css #}
    <link rel="stylesheet" type="text/css" href="{{ url_for_asset('airflowDefaultTheme.css') }}">
  {% endif %}
  <link rel="stylesheet" type="text/css" href="{{ url_for_asset('materialIcons.css') }}">
  <link rel="stylesheet" type="text/css" href="{{ url_for_asset('main.css') }}">
  <link rel="stylesheet" type="text/css" href="{{ url_for_asset('loadingDots.css') }}">
  <link rel="stylesheet" type="text/css" href="{{ url_for_asset('jquery-ui.min.css') }}">
  <style type="text/css">
    {% for state, state_color in state_color_mapping.items() %}
      span.{{state}} {
        background-color: {{state_color}};
      }
    {% endfor %}
    .navbar-nav > li > a {
      color: {{ navbar_text_color }};
    }
    .navbar-nav > li > a:hover {
      background-color:  {{ navbar_hover_color }};
      color: {{ navbar_text_hover_color }};
    }
  </style>
  <link rel="icon" type="image/png" href="{{ url_for('static', filename='pin_32.png') }}">
{% endblock %}

{% block messages %}
  {% include 'appbuilder/flash.html' %}
  {% if show_plugin_message %}
    {% call show_message(category='warning', dismissible=false) %}
      <p>
        You have a plugin that is using a FAB view or Flask Blueprint, which was used for the Airflow 2 UI, and is now
        deprecated. Please update your plugin to be compatible with the Airflow 3 UI.
      </p>
    {% endcall %}
  {% endif %}
{% endblock %}

{% block tail_js %}
  {{ super() }}
  <script>
    // below variables are used in main.js
    // keep as var, changing to const or let breaks other code
    var hostName = '{{ hostname }}';
    $('time[title]').tooltip();
  </script>
  <script src="{{ url_for_asset('moment.js') }}"></script>
  <script src="{{ url_for_asset('jquery-ui.min.js') }}"></script>
  <script src="{{ url_for_asset('main.js') }}"></script>
{% endblock %}
