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) -%}{{ description }}
{%- endmacro %} {% macro list_item_small(title, description, link) -%}{{ description }}
{%- endmacro %} @@ -16,7 +16,7 @@{{ description }}