{#
  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 "airflow/task_instance.html" %}
{% block title %}Airflow - DAGs{% endblock %}

{% block content %}
    {{ super() }}
    <h4>{{ title }}</h4>
    <div>
        <h5>Dependencies Blocking Task From Getting Scheduled</h5>
        <table class="table table-striped table-bordered">
            <tr>
                <th>Dependency</th>
                <th>Reason</th>
            </tr>
            {% for dependency, reason in failed_dep_reasons %}
                <tr>
                    <td>{{ dependency }}</td>
                    {% autoescape false %}
                    <td class='code'>{{ reason }}</td>
                    {% endautoescape %}
                </tr>
            {% endfor %}
        </table>
        {% if html_code is defined %}
            {{ html_code|safe }}
        {% endif %}
    </div>
    <div>
        {% for attr, value in special_attrs_rendered.items() %}
            <h5>Attribute: {{ attr }}</h5>
            {{ value|safe }}
        {% endfor %}
        <h5>Task Instance Attributes</h5>
        <table class="table table-striped table-bordered">
            <tr>
                <th>Attribute</th>
                <th>Value</th>
            </tr>
            {% for attr, value in ti_attrs %}
                <tr>
                    <td>{{ attr }}</td>
                    <td class='code'>{{ value }}</td>
                </tr>
            {% endfor %}
        </table>
        <h5>Task Attributes</h5>
        <table class="table table-striped table-bordered">
            <tr>
                <th>Attribute</th>
                <th>Value</th>
            </tr>
            {% for attr, value in task_attrs %}
                <tr>
                    <td>{{ attr }}</td>
                    <td class='code'>{{ value }}</td>
                </tr>
            {% endfor %}
        </table>
        {% if html_code is defined %}
            {{ html_code|safe }}
        {% endif %}
    </div>
{% endblock %}
