{% load wise_icons wise_tags i18n %}
{% comment %}
The empty state a list falls back to when it has no rows to show - in a
`
` for a data table, or on its own in a card list. It is
Lumen's EmptyState (`{% empty_state %}`: an illustration, a title, one
sentence and one next step) filled in from the list view's context
(`wise_core.mixins.WiseListView`), and it tells the two empty lists apart,
because they need opposite things from the visitor:
* Nothing matched the filters (`filter_kwargs_count`) -> the `search`
illustration, say so and offer a way back to the unfiltered list.
Inviting someone to create a record they can't see because of a filter
is how duplicates get made.
* Nothing exists yet -> the `empty` illustration, name what's missing and
hand over the "New" button, which is `create_url` (set `create_url_name`
on the view) and is already None for a user without the model's `add`
permission.
Every string can be overridden per list, through `{% trans %}` so the
override stays translatable like the defaults. `illustration` is `empty`,
`search` or `none`; `heading_level` is 2 unless the list sits under a deeper
heading:
{% trans "No invoices yet" as empty_title %}
{% include 'wise_core/components/_no_data.html' with title=empty_title illustration="search" %}
See the docs site's Feedback -> Empty State page for the four states.
{% endcomment %}
{% if filter_kwargs_count %}
{% if not title %}{% trans "Nothing matches those filters" as title %}{% endif %}
{% if not text %}
{% if model_verbose_name_plural %}
{% blocktrans with name=model_verbose_name_plural count counter=filter_kwargs_count asvar text %}No {{ name }} match the filter you applied. Clear it to see the full list.{% plural %}No {{ name }} match the {{ counter }} filters you applied. Clear them to see the full list.{% endblocktrans %}
{% else %}
{% blocktrans count counter=filter_kwargs_count asvar text %}No record matches the filter you applied. Clear it to see the full list.{% plural %}No record matches the {{ counter }} filters you applied. Clear them to see the full list.{% endblocktrans %}
{% endif %}
{% endif %}
{% empty_state title=title description=text illustration=illustration|default:"search" heading_level=heading_level %}
{% lucide "x" size="s" %}{% trans "Clear filters" %}
{% endempty_state %}
{% else %}
{% if not title %}
{% if model_verbose_name_plural %}
{% blocktrans with name=model_verbose_name_plural asvar title %}No {{ name }} yet{% endblocktrans %}
{% else %}
{% trans "No records yet" as title %}
{% endif %}
{% endif %}
{% if not text %}
{% if create_url %}
{% if model_verbose_name %}
{% blocktrans with name=model_verbose_name asvar text %}Create the first {{ name }} and it shows up here.{% endblocktrans %}
{% else %}
{% trans "Create the first record and it shows up here." as text %}
{% endif %}
{% else %}
{% trans "Records added here will show up in this list." as text %}
{% endif %}
{% endif %}
{% empty_state title=title description=text illustration=illustration|default:"empty" heading_level=heading_level %}
{% if create_url %}
{% lucide "plus" size="s" %}
{% if create_label %}{{ create_label }}{% elif model_verbose_name %}{% blocktrans with name=model_verbose_name %}New {{ name }}{% endblocktrans %}{% else %}{% trans "New record" %}{% endif %}
{% endif %}
{% endempty_state %}
{% endif %}