generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor to modularise layout * update readme * add section on updating deps
- Loading branch information
1 parent
89ecda5
commit 7dbda54
Showing
16 changed files
with
103 additions
and
17 deletions.
There are no files selected for viewing
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
Empty file.
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,27 @@ | ||
import logging | ||
|
||
from flask import ( | ||
render_template, | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
def server_forbidden(err): | ||
logger.error("server_forbidden(): %s", err) | ||
return render_template("pages/errors/403.html"), 403 | ||
|
||
def page_not_found(err): | ||
logger.error("A request was made to a page that doesn't exist %s", err) | ||
return render_template("pages/errors/404.html"), 404 | ||
|
||
def too_many_requests(err): | ||
logger.error("Too many attempts to access this page %s", err) | ||
return render_template("pages/errors/429.html"), 429 | ||
|
||
def unknown_server_error(err): | ||
logger.error("An unknown server error occurred: %s", err) | ||
return render_template("pages/errors/500.html"), 500 | ||
|
||
def gateway_timeout(err): | ||
logger.error("A gateway timeout error occurred: %s", err) | ||
return render_template("pages/errors/504.html"), 504 |
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,12 @@ | ||
import datetime | ||
import logging | ||
import os | ||
from collections import Counter | ||
from functools import wraps | ||
from urllib.parse import quote_plus, urlencode | ||
|
||
from flask import (Blueprint, abort, current_app, jsonify, redirect, | ||
render_template, render_template_string, request, session, | ||
url_for) | ||
|
||
# Empty as yet |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
application/templates/accessibility.html → ...cation/templates/pages/accessibility.html
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
2 changes: 1 addition & 1 deletion
2
application/templates/cookies.html → application/templates/pages/cookies.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends "components/base.html" %} | ||
|
||
{% block pageTitle %} | ||
Web server forbids you from accessing the page you’re trying to open (403 error) | ||
{% endblock %} | ||
|
||
{% set mainClasses = "govuk-main-wrapper--l" %} | ||
|
||
{% block content %} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl">Web server forbids you from accessing the page you’re trying to open (403 | ||
error)</h1> | ||
<p class="govuk-body">If you entered a web address, please check it was correct.</p> | ||
</div> | ||
</div> | ||
{% endblock %} |
6 changes: 4 additions & 2 deletions
6
application/templates/404.html → application/templates/pages/errors/404.html
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
6 changes: 4 additions & 2 deletions
6
application/templates/429.html → application/templates/pages/errors/429.html
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
6 changes: 4 additions & 2 deletions
6
application/templates/500.html → application/templates/pages/errors/500.html
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
6 changes: 4 additions & 2 deletions
6
application/templates/503.html → application/templates/pages/errors/503.html
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
2 changes: 1 addition & 1 deletion
2
application/templates/privacy.html → application/templates/pages/privacy.html
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