{#
  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.
 #}

{% from 'appbuilder/loading_dots.html' import loading_dots %}

{% macro dataset_next_run_modal(id=None, classes=None) %}
  <div class="modal fade" id="datasetNextRunModal" tabindex="-1" role="dialog" aria-labelledby="datasetNextRunModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="datasetNextRunModalLabel">
            <span class="text-muted">Datasets needed to trigger the next run for</span> <span id="dag_id"></span>
          </h4>
        </div>
        <div class="modal-body">
          <p id="next_run_summary"></p>
          {{ loading_dots(id='datasets-loading-dots', classes='refresh-loading') }}
          <div id="datasets_error" style="display: none; margin-top: 10px;" class="alert alert-danger" role="alert">
            <span class="material-icons" aria-hidden="true">error</span>
            <span id="datasets_error_msg">Oops.</span>
          </div>
          <table class="table table-striped table-bordered table-hover dataset-events">
            <thead>
              <tr>
                <th>Dataset URI</th>
                <th>Latest Update</th>
              </tr>
            </thead>
            <tbody id="datasets_tbody">
            </tbody>
          </table>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
{% endmacro %}
