{% 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. **This template knows no app.** It used to carry a hard-coded block per feature -- content here, shop there, sign-ins below -- which meant that installing an app was only two thirds of installing it: the third part was remembering to edit this file, and an app that nobody remembered shipped with numbers nothing displayed. So it draws whatever `infrastructure.common.adminui.dashboard` hands it. Each app publishes its own section from its own `adminui.py`, checks its own permissions there, and is absent -- heading and all -- when it is not installed or has nothing to tell this particular reader. Adding a section to this page is a function in the app that owns the numbers, and nothing here. A section is a title, some cards (a number, a line about it, somewhere to go), and some panels (figures, bars, a short list, or any combination). That vocabulary is deliberately small: a dashboard whose every block is bespoke is a dashboard nobody can add to without a design conversation. {% 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 %} {% for section in admin_sections %}

{{ section.title }}

{% if section.cards %}
{% for card in section.cards %} {% component "unfold/components/card.html" with href=card.link icon=card.icon %} {{ card.label }}

{{ card.value }}

{{ card.hint }} {% endcomponent %} {% endfor %}
{% endif %} {% if section.panels %}
{% for panel in section.panels %}
{% component "unfold/components/card.html" with title=panel.title %}
{% if panel.figures %}
{% for figure in panel.figures %}
{{ figure.label }}

{{ figure.value }}

{% endfor %}
{% endif %} {% for bar in panel.bars %} {% component "unfold/components/progress.html" with title=bar.label description=bar.value value=bar.percent %}{% endcomponent %} {% endfor %} {% for row in panel.rows %} {{ row.label }} {{ row.hint }} {{ row.right }} {% endfor %} {% if panel.note %} {{ panel.note }} {% endif %} {% if panel.link and panel.link_label %} {{ panel.link_label }} {% endif %}
{% endcomponent %}
{% endfor %}
{% endif %}
{% endfor %}
{% include "unfold/helpers/app_list_default.html" %}
{% include "unfold/helpers/history.html" %}
{% endblock %}