{% extends "base.html" %}
{% load static %}
{% load stricter_templates %}
{% load humanize %}

{% block title %}Model Counts  · {{ site_title }}{% endblock %}

{% block content %}

<div class="m-4">

    <div>
        <h1 class="text-4xl my-4 font-bold">Model Counts</h1>
    </div>

    {% for app_name, model_counts in counts|items %}
    <h1 class="text-2xl font-bold mt-4">{{ app_name|capfirst }}</h1>

    <div class="mb-6">
        {% for key, annotated_count in model_counts|items %}
            <div class="flex {% if forloop.first %}border-slate-300 border-t-2{% endif %}">
                <div class="w-1/6 {% if not forloop.last %}border-b-2 border-dotted border-slate-300{% endif %}">{{ key }}</div>
                <div class="w-1/6 {% if not forloop.last %} border-b-2 border-dotted border-slate-300{% endif %} text-right">{{ annotated_count.count|intcomma }}</div>
                <div class="w-1/6 {% if not forloop.last %} border-b-2 border-dotted border-slate-300{% endif %} pl-4 text-slate-500">{% if annotated_count.timestamp %}cached {{ annotated_count.timestamp|date:"G:i T" }}{% else %}&nbsp;{% endif %}</div>
                <div class="w-1/2 {% if not forloop.last %} border-b-2 border-dotted border-slate-300{% endif %}">&nbsp;</div>

            </div>
        {% endfor %}
    </div>

    {% endfor %}

</div>
{% endblock %}
