Improve translation compatibility, and allow base_report's 'no pages found' message to be customised using a block

This commit is contained in:
jacobtm 2019-10-31 13:06:09 +00:00
parent 83d98d9166
commit b98816ff0b
4 changed files with 10 additions and 3 deletions

View file

@ -3,7 +3,7 @@
<div class="panel nice-padding">{# TODO try moving these classes onto the section tag #}
<section>
<h2>{% trans "Your locked pages" %}</h2>
<a href="{% url 'wagtailadmin_reports:locked_pages' %}" class="button button-small button-secondary">See all locked pages</a>
<a href="{% url 'wagtailadmin_reports:locked_pages' %}" class="button button-small button-secondary">{% trans "See all locked pages" %}</a>
<table class="listing listing-page">
<col />
<col width="15%"/>

View file

@ -14,7 +14,9 @@
{% endblock %}
{% paginate pages base_url=request.path %}
{% else %}
<p>{% trans 'No pages available.' %}</p>
{% block no_results %}
<p>{% trans "No pages match this report's criteria." %}</p>
{% endblock %}
{% endif %}
</div>
</div>

View file

@ -1,4 +1,9 @@
{% extends 'wagtailadmin/reports/base_report.html' %}
{% load i18n %}
{% block listing %}
{% include "wagtailadmin/reports/listing/_list_unlock.html" %}
{% endblock %}
{% block no_results %}
<p>{% trans "No locked pages found." %}</p>
{% endblock %}

View file

@ -1,4 +1,4 @@
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import TemplateResponseMixin
from django.views.generic.list import BaseListView