{# 
  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/dag.html" %}

{% block title %}
    {{ title }}
{% endblock %}

{% block content %}
    {{ super() }}
    <h2>{{ title }}</h2>
    <div>
      {% for state, count in states %}
      <a
          class="btn"
          style="border: none; background-color:{{ State.color(state)}}; color: {{ State.color_fg(state) }};"
          href="{{ url_for('TaskInstanceModelView.list', _flt_3_dag_id=dag.dag_id, _flt_3_state=state) }}">
        {{ state }} <span class="badge">{{ count }}</span>
      </a>
      {% endfor %}
    </div>
    <br>
    <table class="table table-striped table-bordered">
      <tr>
        <th>schedule_interval</td>
        <td>{{ dag.schedule_interval }}</td>
      </tr>
      <tr>
        <th>start_date</td>
        <td>{{ dag.start_date }}</td>
      </tr>
      <tr>
        <th>end_date</td>
        <td>{{ dag.end_date }}</td>
      </tr>
      <tr>
        <th>max_active_runs</td>
        <td>{{ active_runs | length }} / {{ dag.max_active_runs }}</td>
      </tr>
      <tr>
        <th>concurrency</td>
        <td>{{ dag.concurrency }}</td>
      </tr>
      <tr>
        <th>default_args</td>
        <td><code>{{ dag.default_args }}</code></td>
      </tr>
      <tr>
        <th>tasks count</td>
        <td>{{ dag.tasks|length }}</td>
      </tr>
      <tr>
        <th>task ids</td>
        <td>{{ dag.task_ids }}</td>
      </tr>
      <tr>
        <th>filepath</td>
        <td>{{ dag.filepath }}</td>
      </tr>
      <tr>
        <th>owner</td>
        <td>{{ dag.owner }}</td>
      </tr>
    </table >
{% endblock %}
