Allow to switch to admin mode on 404 and 403 page

This commit is contained in:
Raphael Michel
2018-08-21 15:12:26 +02:00
parent b5cd3bf0af
commit 6502fdb1f5
2 changed files with 20 additions and 0 deletions

View File

@@ -10,4 +10,14 @@
<a id='goback' href='#'>{% trans "Take a step back" %}</a>
&middot; <a id='reload' href='#'>{% trans "Try again" %}</a>
</p>
{% if request.user.is_staff and not staff_session %}
<form action="{% url 'control:user.sudo' %}?next={{ request.path|urlencode }}" method="post">
<p>
{% csrf_token %}
<button type="submit" class="btn btn-default" id="button-sudo">
<i class="fa fa-id-card"></i> {% trans "Admin mode" %}
</button>
</p>
</form>
{% endif %}
{% endblock %}