{% extends "core_components/site_base.html" %}
{% block tabtitle %}Simmate{% endblock %}
{% block body %}
    {# Header #}
    <section class="jumbotron text-center">
        <div class="container">
            <h1 class="jumbotron-heading">Data Explorer</h1>
            <p class="lead text-muted">explore and maintain various datasets</p>
        </div>
    </section>
    {# List of Cards #}
    <div class="row">
        {% for section_name, datasets in data_config.items %}
            {% if datasets and section_name != "HIDDEN" %}
                <h3 class="mt-4">{{ section_name }}</h3>
                {% for dataset in datasets %}
                    <div class="col-md-4">
                        <div class="card border-primary border" style="height: 90%">
                            <div class="card-body">
                                <h5 class="card-title text-primary">{{ dataset.html_display_name }}</h5>
                                <p class="card-text">{{ dataset.html_description_short }}</p>
                                <a href="{% url 'data_explorer:table' dataset.table_name %}"
                                   class="btn btn-primary btn-sm">Explore</a>
                                {% if dataset.external_website %}
                                    <a href="{{ dataset.external_website }}"
                                       target="_blank"
                                       class="btn btn-secondary btn-sm">Source Website</a>
                                {% endif %}
                            </div>
                        </div>
                    </div>
                {% endfor %}
            {% endif %}
        {% endfor %}
    </div>
{% endblock %}
