{% extends "fmd_dashboard/overview.html" %}

{% block subcontent %}
    <div class="card">
        <div class="card-header">
            {% block title %}
                <h4>{{ title }}</h4>
            {% endblock %}
        </div>
        <div id="loading">
            <div class="col-md-12 col-sm-12">
                <br>
                <div class="spinner">
                    <div class="rect1"></div>
                    <div class="rect2"></div>
                    <div class="rect3"></div>
                    <div class="rect4"></div>
                    <div class="rect5"></div>
                </div>
            </div>
        </div>
        <div class="card-body">
            {% block graph_content %}
                {% if graph %}
                    <div class="col-sm-12">
                        {{ graph|safe }}
                    </div>
                {% else %}
                    <p>No data available.</p>
                {% endif %}
            {% endblock %}

            <div class="row">
                <div class="col-7">
                    {% block form_content %}
                        {% if form %}
                            <div class="card">
                                <div class="card-header"><h6>{{ form.title }}</h6></div>
                                <div class="card-body">
                                    <form class="form" method="POST">
                                        {{ form.hidden_tag() }}
                                        {{ form.content()|safe }}
                                    </form>
                                </div>
                            </div>
                        {% endif %}
                    {% endblock %}
                </div>
                {% if information %}
                    <div class="col-5" style="float: right">
                        <div class="card">
                            <div class="card-header"><h6>Information</h6></div>
                            <div class="card-body">{{ information|safe }}</div>
                        </div>
                    </div>
                {% endif %}
            </div>
        </div>
    </div>
    {% block graph2 %}
    {% endblock %}
    {% block summary %}
    {% endblock %}
{% endblock %}

{% block script %}
    <script>
        $(window).ready(function () {
            $('#loading').hide();
        });
    </script>
{% endblock %}