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.
Merge branch 'main' of github.com:ministryofjustice/operations-engine…
…ering-example
- Loading branch information
Showing
22 changed files
with
703 additions
and
132 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
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 |
---|---|---|
@@ -1,12 +1,56 @@ | ||
.env | ||
.venv | ||
.terraform/ | ||
coverage/ | ||
venv/ | ||
env/ | ||
.DS_STORE | ||
.vscode | ||
*.code-workspace | ||
*.sha256 | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
### Terraform ### | ||
.terraform/ | ||
terraform.tfstate | ||
__pycache__/ | ||
|
||
### GOV.UK Frontend ### | ||
application/static/* | ||
govuk_components* | ||
|
||
### Flask ### | ||
instance/* | ||
!instance/.gitignore | ||
.webassets-cache | ||
|
||
### Flask.Python Stack ### | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Distribution / packaging | ||
.Python | ||
build | ||
lib/ | ||
lib64/ | ||
var/ | ||
wheels/ | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
coverage/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ |
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,28 @@ | ||
from flask import Flask, render_template, url_for | ||
import logging | ||
import os | ||
|
||
from flask import Flask | ||
from flask_cors import CORS | ||
from jinja2 import ChoiceLoader, PackageLoader, PrefixLoader | ||
|
||
from config import Config | ||
|
||
|
||
app = Flask(__name__) | ||
app.config.from_object(Config) | ||
|
||
app.jinja_loader = ChoiceLoader( | ||
[ | ||
PackageLoader("application"), | ||
PrefixLoader({"govuk_frontend_jinja": PackageLoader("govuk_frontend_jinja")}), | ||
] | ||
) | ||
|
||
app.jinja_env.trim_blocks = True | ||
app.jinja_env.lstrip_blocks = True | ||
|
||
|
||
@app.route("/", methods=["GET", "POST"]) | ||
def index(): | ||
return render_template("index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block pageTitle %}Page not found – {{config['SERVICE_NAME']}} – GOV.UK{% 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-l">Page not found</h1> | ||
<p class="govuk-body">If you typed the web address, check it is correct.</p> | ||
<p class="govuk-body">If you pasted the web address, check you copied the entire address.</p> | ||
</div> | ||
</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,15 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block pageTitle %}Too many requests – {{config['SERVICE_NAME']}} – GOV.UK{% 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-l">Sorry, there is a problem</h1> | ||
<p class="govuk-body">There have been too many attempts to access this page.</p> | ||
<p class="govuk-body">Try again later.</p> | ||
</div> | ||
</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,15 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block pageTitle %}Sorry, there is a problem with the service – {{config['SERVICE_NAME']}} – GOV.UK{% 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-l">Sorry, there is a problem with the service</h1> | ||
<p class="govuk-body">Try again later.</p> | ||
<p class="govuk-body">We saved your answers. They will be available for 30 days.</p> | ||
</div> | ||
</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,14 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block pageTitle %}Sorry, the service is unavailable – {{config['SERVICE_NAME']}} – GOV.UK{% 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-l">Sorry, the service is unavailable</h1> | ||
<p class="govuk-body">You will be able to use the service from 9am on Monday 19 November 2018.</p> | ||
</div> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.