mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Use page_perms directly instead of copying into template context
This commit is contained in:
parent
52638a1a6c
commit
e4dfbac2b8
@ -18,8 +18,8 @@
|
||||
<button
|
||||
type="submit"
|
||||
class="status-tag {{ page.locked|yesno:'primary,secondary' }}{% if not form_action %} disabled{% endif %}"
|
||||
aria-label="{% if page_locked %}{% if user_can_unlock %}{% trans 'Remove editor lock. Current status: Locked' %}{% else %}{% trans 'Current status: Locked' %}{% endif %}{% else %}{% trans 'Apply editor lock. Current status: Unlocked' %}{% endif %}">
|
||||
{% if page_locked %}
|
||||
aria-label="{% if page_perms.page_locked %}{% if page_perms.can_unlock %}{% trans 'Remove editor lock. Current status: Locked' %}{% else %}{% trans 'Current status: Locked' %}{% endif %}{% else %}{% trans 'Apply editor lock. Current status: Unlocked' %}{% endif %}">
|
||||
{% if page_perms.page_locked %}
|
||||
{% trans "Locked" %}
|
||||
{% elif user_has_lock %}
|
||||
{% trans "Locked by you" %}
|
||||
|
@ -547,9 +547,7 @@ def edit(request, page_id):
|
||||
'form': form,
|
||||
'next': next_url,
|
||||
'has_unsaved_changes': has_unsaved_changes,
|
||||
'page_locked': page_locked,
|
||||
'user_has_lock': user_has_lock,
|
||||
'user_can_unlock': page_perms.can_unlock(),
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user