Make get_current_admin error to 401 and add 401 error page.

This commit is contained in:
long2ice
2021-08-31 11:27:23 +08:00
parent 2fcbc814de
commit e99d673191
5 changed files with 44 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
{% extends 'base.html' %}
{% block body %}
<div class="page page-center">
<div class="container-tight py-4">
<div class="empty">
<div class="empty-header">401</div>
<p class="empty-title">Oops… You are unauthorized</p>
<p class="empty-subtitle text-muted">
We are sorry but the page you are looking for need authorization.
</p>
<div class="empty-action">
<a href="{{ request.app.admin_path }}" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<line x1="5" y1="12" x2="19" y2="12"/>
<line x1="5" y1="12" x2="11" y2="18"/>
<line x1="5" y1="12" x2="11" y2="6"/>
</svg>
{{ _('return_home') }}
</a>
</div>
</div>
</div>
</div>
{% endblock %}