diff --git a/app/categories/__init__.py b/app/categories/__init__.py index 464c62da..96334791 100644 --- a/app/categories/__init__.py +++ b/app/categories/__init__.py @@ -2,7 +2,7 @@ from .domestic_abuse import bp as domestic_abuse_bp from .discrimination import bp as discrimination_bp -bp = Blueprint("categories", __name__, template_folder="templates") +bp = Blueprint("categories", __name__) bp.register_blueprint(domestic_abuse_bp) bp.register_blueprint(discrimination_bp) diff --git a/app/categories/discrimination/routes.py b/app/categories/discrimination/routes.py index 578ff9ac..4c361522 100644 --- a/app/categories/discrimination/routes.py +++ b/app/categories/discrimination/routes.py @@ -1,5 +1,5 @@ from app.categories.discrimination import bp -from flask import render_template, url_for, flash, redirect +from flask import render_template, url_for, flash, redirect, current_app from app.categories.discrimination.forms import ( DiscriminationWhereForm, DiscriminationWhyForm, @@ -14,17 +14,10 @@ def where_did_the_discrimination_happen(): items = get_items_with_divisor(form.question.choices) if form.validate_on_submit(): - if form.question.data == "work": - return redirect( - url_for( - "categories.discrimination.why_were_you_treated_differently", - where=form.question.data, - ) - ) flash("End of prototype") return render_template( - "question-page.html", + "categories/question-page.html", form=form, items=items, back_link=url_for("categories.index"), @@ -40,12 +33,12 @@ def why_were_you_treated_differently(where): if form.validate_on_submit(): if form.question.data == "disability": return redirect( - "https://checklegalaid.service.gov.uk/legal-aid-available?hlpas=no" + f"{current_app.config['CLA_PUBLIC_URL']}/discrimination_means" ) flash("End of prototype") return render_template( - "question-page.html", + "categories/question-page.html", form=form, items=items, back_link=url_for( diff --git a/app/categories/domestic_abuse/routes.py b/app/categories/domestic_abuse/routes.py index 273445c6..7041bb8c 100644 --- a/app/categories/domestic_abuse/routes.py +++ b/app/categories/domestic_abuse/routes.py @@ -1,12 +1,12 @@ from app.categories.domestic_abuse import bp -from flask import render_template, url_for, redirect, flash +from flask import render_template, url_for, flash from app.categories.domestic_abuse.forms import AreYouAtRiskOfHarmForm @bp.route("") def index(): return render_template( - "domestic-abuse.html", + "categories/domestic-abuse.html", back_link=url_for("categories.index"), ) @@ -16,12 +16,10 @@ def are_you_at_immediate_risk_of_harm(): form = AreYouAtRiskOfHarmForm() if form.validate_on_submit(): - if form.question.data == "yes": - return redirect("https://checklegalaid.service.gov.uk/contact") flash("End of prototype") return render_template( - "question-page.html", + "categories/question-page.html", form=form, back_link=url_for("categories.domestic_abuse.index"), ) diff --git a/app/categories/routes.py b/app/categories/routes.py index 455ed7a6..677beee6 100644 --- a/app/categories/routes.py +++ b/app/categories/routes.py @@ -4,9 +4,9 @@ @bp.route("/") def index(): - return render_template("index.html") + return render_template("categories/index.html") @bp.route("/more-problems") def more_problems(): - return render_template("more-problems.html") + return render_template("categories/more-problems.html") diff --git a/app/templates/base.html b/app/templates/base.html index cafeed28..c2ef3d50 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -123,7 +123,7 @@ 'tag': { 'text': config['SERVICE_PHASE'], }, - 'html': 'This is a new service – your feedback will help us to improve it.' + 'html': 'Contact us if you need help or would like to give feedback to improve this service' }) }}

Prototype

diff --git a/app/categories/templates/components/list-item.html b/app/templates/categories/components/list-item.html similarity index 90% rename from app/categories/templates/components/list-item.html rename to app/templates/categories/components/list-item.html index 5b67833d..7fbc78a8 100644 --- a/app/categories/templates/components/list-item.html +++ b/app/templates/categories/components/list-item.html @@ -1,14 +1,14 @@ {# These macros are used to populate the items in the category information list. #} {% macro list_item(title, description, link) -%}

- {{ title }} + {{ title }}

{{ description }}

{%- endmacro %} {% macro list_item_small(title, description, link) -%}

- {{ title }} + {{ title }}

{{ description }}

{%- endmacro %} @@ -16,7 +16,7 @@

{% macro list_item_arrow(title, description, link) -%}

- {{ title }} + {{ title }}

{{ description }}

diff --git a/app/categories/templates/domestic-abuse.html b/app/templates/categories/domestic-abuse.html similarity index 91% rename from app/categories/templates/domestic-abuse.html rename to app/templates/categories/domestic-abuse.html index bff2a91c..0dc58486 100644 --- a/app/categories/templates/domestic-abuse.html +++ b/app/templates/categories/domestic-abuse.html @@ -1,7 +1,8 @@ {# This page was built as a prototype #} {% extends "base.html" %} {%- from 'govuk_frontend_jinja/components/back-link/macro.html' import govukBackLink -%} -{%- from 'components/list-item.html' import list_item, list_item_small -%} +{%- from 'govuk_frontend_jinja/components/exit-this-page/macro.html' import govukExitThisPage -%} +{%- from 'categories/components/list-item.html' import list_item, list_item_small -%} {% block pageTitle %}Domestic Abuse - GOV.UK{% endblock %} @@ -11,6 +12,9 @@ 'href': url_for('categories.index'), 'text': "Back" }) }} + +{{ govukExitThisPage("Exit this page")}} + {% endblock %} {% block content %} diff --git a/app/categories/templates/index.html b/app/templates/categories/index.html similarity index 97% rename from app/categories/templates/index.html rename to app/templates/categories/index.html index 00dbd00c..05183432 100644 --- a/app/categories/templates/index.html +++ b/app/templates/categories/index.html @@ -2,7 +2,7 @@ {% extends "base.html" %} {%- from 'govuk_frontend_jinja/components/button/macro.html' import govukButton -%} -{%- from 'components/list-item.html' import list_item, list_item_small, list_item_arrow -%} +{%- from 'categories/components/list-item.html' import list_item, list_item_small, list_item_arrow -%} {% block content %} diff --git a/app/categories/templates/more-problems.html b/app/templates/categories/more-problems.html similarity index 95% rename from app/categories/templates/more-problems.html rename to app/templates/categories/more-problems.html index 259b8fe2..2d66ec79 100644 --- a/app/categories/templates/more-problems.html +++ b/app/templates/categories/more-problems.html @@ -1,7 +1,7 @@ {# This page was built as a prototype #} {% extends "base.html" %} {%- from 'govuk_frontend_jinja/components/back-link/macro.html' import govukBackLink-%} -{%- from 'components/list-item.html' import list_item, list_item_small -%} +{%- from 'categories/components/list-item.html' import list_item, list_item_small -%} {% block beforeContent%} {{ super() }} @@ -27,8 +27,7 @@

More problems covered by legal aid

{{ list_item_small("Clinical negligence in babies", "Help if a baby has brain or nerve damage caused during pregnancy, childbirth or up to 8 weeks old.", - "https://checklegalaid.service.gov.uk/scope/refer/legal-adviser?category=clinneg&hlpas=no" -) }} + "https://checklegalaid.service.gov.uk/scope/refer/legal-adviser?category=clinneg&hlpas=no") }} {{ list_item_small("Compensation for abuse, assault or neglect", "Includes child abuse, sexual assault, abuse of a vulnerable adult. Claims can be against a person or an organisation.", diff --git a/app/categories/templates/question-page.html b/app/templates/categories/question-page.html similarity index 81% rename from app/categories/templates/question-page.html rename to app/templates/categories/question-page.html index 2142f673..e24a0524 100644 --- a/app/categories/templates/question-page.html +++ b/app/templates/categories/question-page.html @@ -1,6 +1,7 @@ {# This page was built as a prototype #} {% extends "base.html" %} {%- from 'govuk_frontend_jinja/components/back-link/macro.html' import govukBackLink -%} +{%- from 'govuk_frontend_jinja/components/exit-this-page/macro.html' import govukExitThisPage -%} {% block pageTitle %}{%- if form.errors %}Error: {% endif -%}{{ form.title }} - GOV.UK{% endblock %} @@ -10,6 +11,11 @@ 'href': back_link, 'text': "Back" }) }} + +{% if form.category == "Domestic Abuse" %} + {{ govukExitThisPage("Exit this page")}} +{% endif %} + {% endblock %} {% block content %}