Make locked pages listing compatible with translation

This commit is contained in:
jacobtm 2020-01-02 11:03:45 +00:00
parent 7421590dc7
commit 7a6ec88838

View file

@ -2,13 +2,28 @@
{% load i18n wagtailadmin_tags %}
{% block page_navigation %}
<td>
{% page_permissions page as perms %}
<p>
Locked
{% if page.locked_by %}by <b>{% if page.locked_by_id == request.user.pk %}you{% else %}{{ page.locked_by }}{% endif %}</b>{% endif %}
{% if page.locked_at %}at <b>{{ page.locked_at|date:"d M Y H:i" }}</b>{% endif %}
{% with page.locked_at|date:"d M Y H:i" as locking_date %}
{% if page.locked_by %}
{% if page.locked_by_id == request.user.pk %}
{% blocktrans %}
Locked by <b>you</b> at <b>{{ locking_date }}</b>
{% endblocktrans %}
{% else %}
{% blocktrans with locked_by=page.locked_by %}
Locked by <b>{{ locked_by }}</b> at <b>{{ locking_date }}</b>
{% endblocktrans %}
{% endif %}
{% else %}
{% blocktrans %}
Locked at <b>{{ locking_date }}</b>
{% endblocktrans %}
{% endif %}
{% endwith %}
</p>
{% if perms.can_unlock %}
<form action="{% url 'wagtailadmin_pages:unlock' page.id %}" method="post">