{% extends "datashow/base.html" %}
{% load datashow_tags i18n humanize %}
{% block title %}
    {{ dataset.name }}
{% endblock title %}
{% block content %}
    {% block datashow_indexheader %}
        <h1>{{ dataset.name }}</h1>
        {% if dataset.description %}<div class="my-3">{{ dataset.description|markdownify }}</div>{% endif %}
    {% endblock datashow_indexheader %}
    {% block datashow_indexbody %}
        {% for table in tables %}
            <h5 class="mb-1">
                <a href="{{ table.get_absolute_url }}">{{ table.label }}</a>
            </h5>
            <small>{{ table.row_count|intcomma }} {% translate "rows" %}</small>
            {% if not forloop.last %}<hr />{% endif %}
        {% endfor %}
    {% endblock datashow_indexbody %}
    {% block datashow_indexfooter %}
        <div class="row my-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>
    {% endblock datashow_indexfooter %}
{% endblock content %}
