-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1716 from unicef/28750-add-404-page
[ch28750] Added a 404 & 500 html page
- Loading branch information
Showing
8 changed files
with
525 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django import template | ||
from django.conf import settings | ||
from django.utils.safestring import mark_safe | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag | ||
def matomo_settings(name): | ||
_settings = ("MATOMO_HOST_URL", "MATOMO_TRACKER_URL", "MATOMO_SITE_ID") | ||
if name in _settings: | ||
return mark_safe(getattr(settings, name, '')) | ||
return '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{% extends "http_codes_base.html" %} | ||
|
||
{% block content %} | ||
<div class="errorContent"> | ||
<section id="error-container"> | ||
|
||
<div class="block-error"> | ||
|
||
<header> | ||
<h1 class="error primary-txt">404 - Page Not Found</h1> | ||
</header> | ||
|
||
<p class="text-center">We're having trouble loading the page you are looking for.</p> | ||
{% for message in messages %} | ||
<p class="text-center">{{ message }}</p> | ||
{% endfor %} | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<a class="btn btn-info btn-block btn-3d" href="{% url 'home' %}">Back to Dashboard</a> | ||
</div> | ||
<br> | ||
<br> | ||
<div class="col-md-6"> | ||
<button class="btn btn-primary btn-block btn-3d" onclick="history.back();">Previous Page</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</section> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% extends "http_codes_base.html" %} | ||
|
||
|
||
{% block content %} | ||
<div class="errorContent"> | ||
<section id="error-container"> | ||
|
||
<div class="block-error"> | ||
|
||
<header> | ||
<h1 class="error primary-txt">500 - Something went wrong</h1> | ||
</header> | ||
|
||
<p class="text-center">Our engineers have have been notified and will address the issue shortly</p> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<a class="btn btn-info btn-block btn-3d" href="{% url 'home' %}">Back to Dashboard</a> | ||
</div> | ||
<br> | ||
<br> | ||
<div class="col-md-6"> | ||
<button class="btn btn-primary btn-block btn-3d" onclick="history.back();">Previous Page</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</section> | ||
</div> | ||
{% endblock content %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{% load prp %} | ||
|
||
<!doctype html> | ||
|
||
<html lang=""> | ||
|
||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta charset="utf-8"> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="generator" content="UNICEF Partner Reporting Portal" /> | ||
<title>"UNICEF Partner Reporting Portal"</title> | ||
<meta name="theme-color" content="#2E3AA1"> | ||
|
||
<!-- Matomo --> | ||
<script> | ||
var _paq = window._paq = window._paq || []; | ||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ | ||
_paq.push(['trackPageView']); | ||
_paq.push(['enableLinkTracking']); | ||
(function() { | ||
var u='{% matomo_settings "MATOMO_HOST_URL" %}'; | ||
_paq.push(['setTrackerUrl', u+'{% matomo_settings "MATOMO_TRACKER_URL" %}']); | ||
_paq.push(['setSiteId', '{% matomo_settings "MATOMO_SITE_ID" %}']); | ||
_paq.push(['setUserId', '{{ request.user.pk }}']); | ||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | ||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); | ||
})(); | ||
</script> | ||
<!-- End Matomo Code --> | ||
|
||
{% block extra_head %} | ||
|
||
<style> | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
.unicefblue { | ||
background-color: #15274f; | ||
} | ||
|
||
.medium-tall{ | ||
padding: 1%; | ||
height: 100px; | ||
background-color: #15274f; | ||
color: #ffffff; | ||
} | ||
|
||
.bottom{ | ||
padding-top: 2%; | ||
} | ||
.errorContent{ | ||
margin: 0 auto; | ||
display: block; | ||
text-align: center; | ||
padding-top: 3em; | ||
} | ||
|
||
</style> | ||
|
||
|
||
{% endblock %} | ||
|
||
</head> | ||
|
||
<body class="fullbleed vertical layout"> | ||
{% block toolbar %} | ||
<div class="medium-tall"> | ||
<img src="/api/static/images/unicefetools.svg" width="200px"> | ||
<img src="/api/static/images/IP-logo.png" width="300px" max-width="120%" align="right"/> | ||
</div> | ||
{% endblock toolbar %} | ||
|
||
|
||
{% block content %} | ||
{% endblock content %} | ||
{% block extra_js %} | ||
{% endblock %} | ||
</body> | ||
|
||
</html> |