Closes #4945: Add a user-friendly 403 error page

This commit is contained in:
Jeremy Stretch 2020-08-05 10:40:45 -04:00
parent e6df6dc7f4
commit 42ebf0a546
4 changed files with 37 additions and 18 deletions

View File

@ -5,7 +5,8 @@
### Enhancements
* [#4919](https://github.com/netbox-community/netbox/issues/4919) - Allow adding/changing assigned permissions within group and user admin views
* [#4940](https://github.com/netbox-community/netbox/issues/4940) - Added an `occupied` field to rack unit representations for rack elevation views
* [#4940](https://github.com/netbox-community/netbox/issues/4940) - Add an `occupied` field to rack unit representations for rack elevation views
* [#4945](https://github.com/netbox-community/netbox/issues/4945) - Add a user-friendly 403 error page
### Bug Fixes

View File

@ -0,0 +1,9 @@
{% extends '40x.html' %}
{% block title %}Access Denied{% endblock %}
{% block icon %}<i class="glyphicon glyphicon-lock"></i>{% endblock %}
{% block message %}
You do not have permission to access this page.
{% endblock %}

View File

@ -1,19 +1,9 @@
{% extends 'base.html' %}
{% extends '40x.html' %}
{% block content %}
<div class="row" style="margin-top: 150px;">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default">
<div class="panel-heading">
<strong><i class="glyphicon glyphicon-warning-sign"></i> Page Not Found</strong>
</div>
<div class="panel-body">
The requested page does not exist.
</div>
<div class="panel-footer text-right">
<a href="{% url 'home' %}" class="btn btn-xs btn-primary">Home Page</a>
</div>
</div>
</div>
</div>
{% block title %}Page Not Found{% endblock %}
{% block icon %}<i class="glyphicon glyphicon-warning-sign"></i>{% endblock %}
{% block message %}
The requested page does not exist.
{% endblock %}

19
netbox/templates/40x.html Normal file
View File

@ -0,0 +1,19 @@
{% extends 'base.html' %}
{% block content %}
<div class="row" style="margin-top: 150px;">
<div class="col-sm-4 col-sm-offset-4">
<div class="panel panel-default">
<div class="panel-heading">
<strong>{% block icon %}{% endblock %} {% block title %}{% endblock %}</strong>
</div>
<div class="panel-body">
{% block message %}{% endblock %}
</div>
<div class="panel-footer text-right">
<a href="{% url 'home' %}" class="btn btn-xs btn-primary">Home Page</a>
</div>
</div>
</div>
</div>
{% endblock %}