{% extends "datashow/base.html" %}
{% load i18n datashow_tags %}
{% block title %}
    {{ table.label }}
{% endblock title %}
{% block content %}
    {% block datashow_header %}
        {% if dataset.default_table != table %}
            <a href="{% url "datashow:dataset-index" dataset.slug %}">← {{ dataset.name }}</a>
        {% endif %}
        <div class="row mb-3">
            <div class="col-md-8">
                <h1>{{ table.label }}</h1>
                {% if table.description %}<div>{{ table.description|markdownify }}</div>{% endif %}
            </div>
        </div>
    {% endblock datashow_header %}
    {% block datashow_table %}
        {% include "datashow/_table.html" %}
    {% endblock datashow_table %}
    {% block datashow_footer %}
        {% if dataset.default_table == table %}
            <div class="row mt-md-0 mt-3 mb-3 justify-content-end">
                <div class="col-md-8">
                    <div class="d-flex justify-content-end">
                        <a href="{{ dataset.sqlite_file.url }}" class="btn btn-sm btn-secondary">{% translate "Download SQLite database" %}</a>
                    </div>
                </div>
            </div>
        {% endif %}
    {% endblock datashow_footer %}
{% endblock content %}
