{% extends 'admin/base.html' %} {% comment %} The admin's front page, replaced. Django's is a list of models, which answers "what exists" and never "what needs doing" -- so an editor lands on a menu and has to go looking for the page they were asked to change. The cards above the model list are the numbers that change what somebody does next: how much of the site is translated, which required content is still empty, whether sign-ins have started failing, what has been ordered, what the shop has run out of, and which of the dates somebody wrote down is now close enough to do something about. Each is filled in by infrastructure.common.adminui.dashboard, each is permission-checked there, and each is missing rather than empty when its app is not installed. {% endcomment %} {% load i18n unfold %} {% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %} {% block branding %} {% include "unfold/helpers/site_branding.html" %} {% endblock %} {% block content %} {% if content_numbers or shop_numbers or account_numbers or site_events.tracked %}
{% if content_numbers %} {% component "unfold/components/card.html" with href=content_numbers.pages_link icon="web" %} {% trans "Published pages" %}

{{ content_numbers.pages }}

{{ content_numbers.sections }} {% trans "sections" %}{% if content_numbers.drafts %} · {{ content_numbers.drafts }} {% trans "draft(s)" %}{% endif %} {% endcomponent %} {% component "unfold/components/card.html" with icon="text_fields" %} {% trans "Content fields" %}

{{ content_numbers.fields }}

{% trans "across" %} {{ content_numbers.languages|length }} {% trans "language(s)" %} {% endcomponent %} {% component "unfold/components/card.html" with icon="warning" %} {% trans "Required, still empty" %}

{{ content_numbers.required_missing }}

{% if content_numbers.required_missing %}{% trans "fields a page still needs" %}{% else %}{% trans "everything required is written" %}{% endif %} {% endcomponent %} {% endif %} {% if site_events and site_events.tracked %} {% component "unfold/components/card.html" with href=site_events.link icon="event" %} {% trans "Upcoming site events" %}

{{ site_events.total }}

{% if site_events.overdue %}{{ site_events.overdue }} {% trans "already overdue" %}{% else %}{{ site_events.tracked }} {% trans "date(s) being watched" %}{% endif %} {% endcomponent %} {% endif %} {% if shop_numbers %} {% component "unfold/components/card.html" with href=shop_numbers.orders_link icon="receipt_long" %} {% trans "Orders, last 7 days" %}

{{ shop_numbers.orders_week }}

{{ shop_numbers.revenue_week }} {% trans "taken" %} {% endcomponent %} {% component "unfold/components/card.html" with href=shop_numbers.orders_link icon="local_shipping" %} {% trans "Waiting to go out" %}

{{ shop_numbers.to_send }}

{% if shop_numbers.awaiting_payment %}{{ shop_numbers.awaiting_payment }} {% trans "still awaiting payment" %}{% else %}{% trans "nothing is awaiting payment" %}{% endif %} {% endcomponent %} {% component "unfold/components/card.html" with href=shop_numbers.products_link icon="inventory_2" %} {% trans "Out of stock" %}

{{ shop_numbers.out_of_stock }}

{% if shop_numbers.low_stock %}{{ shop_numbers.low_stock }} {% trans "more running low" %}{% else %}{% trans "nothing else is running low" %}{% endif %} {% endcomponent %} {% component "unfold/components/card.html" with href=shop_numbers.reviews_link icon="reviews" %} {% trans "Reviews to moderate" %}

{{ shop_numbers.reviews_waiting }}

{% if shop_numbers.reviews_waiting %}{% trans "nobody can read these yet" %}{% else %}{% trans "the queue is empty" %}{% endif %} {% endcomponent %} {% endif %} {% if account_numbers %} {% component "unfold/components/card.html" with href=account_numbers.link icon="person" %} {% trans "Accounts" %}

{{ account_numbers.total }}

{{ account_numbers.recent }} {% trans "joined this week" %} {% endcomponent %} {% endif %}
{% endif %} {% if content_numbers or sign_in_numbers or site_events.events %}
{% if content_numbers %} {% component "unfold/components/card.html" with title=_("Translation coverage") %}
{% for row in content_numbers.coverage %} {% component "unfold/components/progress.html" with title=row.language description=row.percent|stringformat:"s"|add:"%" value=row.percent %}{% endcomponent %} {% endfor %} {% trans "A field with no translation falls back to the default language, so a page always renders." %}
{% endcomponent %} {% endif %} {% if site_events.events %} {% component "unfold/components/card.html" with title=_("Upcoming site events") %}
{% for event in site_events.events %} {{ event.name }} {{ event.kind }} · {{ event.date|date:"j M Y" }} {% if event.overdue %}{% trans "overdue" %}{% elif event.days == 0 %}{% trans "today" %}{% else %}{% blocktrans with days=event.days %}in {{ days }} day(s){% endblocktrans %}{% endif %} {% endfor %} {% if site_events.total > site_events.events|length %} {% blocktrans with more=site_events.total %}{{ more }} in all{% endblocktrans %} {% endif %}
{% endcomponent %} {% endif %} {% if sign_in_numbers %} {% component "unfold/components/card.html" with title=_("Sign-ins, last 7 days") %}
{% trans "Succeeded" %}

{{ sign_in_numbers.succeeded }}

{% trans "Failed" %}

{{ sign_in_numbers.failed }}

{% trans "Success rate" %}

{{ sign_in_numbers.success_rate }}%

{% for row in sign_in_numbers.by_method %} {% component "unfold/components/progress.html" with title=row.method description=row.count value=row.count %}{% endcomponent %} {% empty %} {% trans "Nobody has signed in this week." %} {% endfor %}
{% endcomponent %} {% endif %}
{% endif %}
{% include "unfold/helpers/app_list_default.html" %}
{% include "unfold/helpers/history.html" %}
{% endblock %}