diff --git a/static/images/cdh_404.webp b/static/images/cdh_404.webp new file mode 100644 index 00000000..31d07f63 Binary files /dev/null and b/static/images/cdh_404.webp differ diff --git a/static/images/cdh_500.webp b/static/images/cdh_500.webp new file mode 100644 index 00000000..8243be00 Binary files /dev/null and b/static/images/cdh_500.webp differ diff --git a/templates/404.html b/templates/404.html index 4884360e..23380129 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,7 +1,12 @@ {% extends 'error_base.html' %} -{% load static %} +{% load static wagtailcore_tags %} {# defaults to 404, but pass error code and message for alternate use #} -{% block page-title %}{{ page_title|default:'Not Found' }}{% endblock %} +{% firstof page_title 'Not Found' as title %} -{% block error-code %}{{ error_code|default:'404' }}{% endblock %} -{% block message %}{{ message|default:"We can’t seem to find the page you’re looking for." }}{% endblock %} +{% block content %} +{% with desc=message|default:"We can't seem to find the page you're looking for." %} +{% with image_src='images/cdh_404.webp' %} + {% include 'includes/error_hero.html' with title='Error 404' description=desc image_src=image_src %} +{% endwith %} +{% endwith %} +{% endblock %} diff --git a/templates/500.html b/templates/500.html index 7b64c9f8..c5ba34ab 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,23 +1,12 @@ -{% load static wagtailuserbar wagtailcore_tags wagtailimages_tags %} - - - - - Error 500 - - - - - - - -
-

Error 500

-

Something went wrong. Please try reloading the page, or return to home.

-
- - {% if SENTRY_DSN_FED %} - - {% endif %} - - +{% extends 'error_base.html' %} +{% load static wagtailcore_tags %} +{# defaults to 404, but pass error code and message for alternate use #} +{% firstof page_title 'Not Found' as title %} + +{% block content %} +{% with desc=message|default:"Something went wrong. Please try reloading the page, or return to home" %} +{% with image_src='images/cdh_500.webp' %} + {% include 'includes/error_hero.html' with title='Error 500' description=desc %} +{% endwith %} +{% endwith %} +{% endblock %} \ No newline at end of file diff --git a/templates/error_base.html b/templates/error_base.html index 1d48936e..d550d246 100644 --- a/templates/error_base.html +++ b/templates/error_base.html @@ -4,10 +4,9 @@ {% block page-title %}Error{% endblock %} {% block main %} -
-
-

Error {% block error-code %}{% endblock %}

-

{% block message %}{% endblock %}

-
-
+ + {% block content %} + + {% endblock %} + {% endblock %} \ No newline at end of file diff --git a/templates/includes/error_hero.html b/templates/includes/error_hero.html new file mode 100644 index 00000000..00e9f972 --- /dev/null +++ b/templates/includes/error_hero.html @@ -0,0 +1,18 @@ +{% load static wagtailcore_tags wagtailimages_tags l10n %} + +
+ +

{{ title }}

+
+ {% if description %} + {{ description | richtext }} + {% endif %} +
+ + + + +