From 42ebf0a546d52962e4b6a3064c41ef9054f5dd57 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 5 Aug 2020 10:40:45 -0400 Subject: [PATCH] Closes #4945: Add a user-friendly 403 error page --- docs/release-notes/version-2.9.md | 3 ++- netbox/templates/403.html | 9 +++++++++ netbox/templates/404.html | 24 +++++++----------------- netbox/templates/40x.html | 19 +++++++++++++++++++ 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 netbox/templates/403.html create mode 100644 netbox/templates/40x.html diff --git a/docs/release-notes/version-2.9.md b/docs/release-notes/version-2.9.md index 8df4e10ce..d564978bd 100644 --- a/docs/release-notes/version-2.9.md +++ b/docs/release-notes/version-2.9.md @@ -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 diff --git a/netbox/templates/403.html b/netbox/templates/403.html new file mode 100644 index 000000000..6a114301f --- /dev/null +++ b/netbox/templates/403.html @@ -0,0 +1,9 @@ +{% extends '40x.html' %} + +{% block title %}Access Denied{% endblock %} + +{% block icon %}{% endblock %} + +{% block message %} + You do not have permission to access this page. +{% endblock %} diff --git a/netbox/templates/404.html b/netbox/templates/404.html index f2fe6b430..22c17fed4 100644 --- a/netbox/templates/404.html +++ b/netbox/templates/404.html @@ -1,19 +1,9 @@ -{% extends 'base.html' %} +{% extends '40x.html' %} -{% block content %} -
-
-
-
- Page Not Found -
-
- The requested page does not exist. -
- -
-
-
+{% block title %}Page Not Found{% endblock %} + +{% block icon %}{% endblock %} + +{% block message %} + The requested page does not exist. {% endblock %} diff --git a/netbox/templates/40x.html b/netbox/templates/40x.html new file mode 100644 index 000000000..d923d001e --- /dev/null +++ b/netbox/templates/40x.html @@ -0,0 +1,19 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+ {% block icon %}{% endblock %} {% block title %}{% endblock %} +
+
+ {% block message %}{% endblock %} +
+ +
+
+
+{% endblock %}