Skip to content

Commit

Permalink
Merge pull request #1256 from ministryofjustice/feature/LGA-3027-hlpa…
Browse files Browse the repository at this point in the history
…s-page-after-means

LGA-3027 - Add hlpas page after user fails means
  • Loading branch information
said-moj committed Apr 29, 2024
2 parents 635bec9 + 5278733 commit c817266
Show file tree
Hide file tree
Showing 14 changed files with 432 additions and 267 deletions.
1 change: 1 addition & 0 deletions cla_public/apps/checker/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
),
("other", _(u"Any other problem"), ""),
("traffickingandslavery", _(u"Modern slavery"), ""),
("hlpas", _("Housing Loss Prevention Advice Scheme"), ""),
]

# Mapping LAALAA category codes to CLA category codes
Expand Down
6 changes: 5 additions & 1 deletion cla_public/apps/checker/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,5 +699,9 @@ class ReviewForm(BaseForm):


class FindLegalAdviserForm(Honeypot, BabelTranslationsFormMixin, Form):
postcode = StringField(_(u"Enter postcode"), validators=[InputRequired(_(u"Enter a postcode"))])
postcode = StringField(
_(u"Enter postcode"),
validators=[InputRequired(_(u"Enter a postcode"))],
description=_(u"For example, SW1H 9AJ."),
)
category = StringField()
10 changes: 10 additions & 0 deletions cla_public/apps/checker/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def complete(self):
"outcome": "referred/help-organisations/means",
}
)
is_hlpas = session.stored.get("hlpas", "")
if is_hlpas.lower() == "yes":
return self.redirect(url_for("checker.hlpas_page"))

return self.redirect(url_for(".help_organisations", category_name=session.checker.category_slug))

if session.checker.need_more_info:
Expand Down Expand Up @@ -439,6 +443,12 @@ def get(self, category_name):
)


@checker.route("/result/hlpas")
def hlpas_page():
context = {"url": url_for(".face-to-face", category="hlpas", hlpas="yes")}
return render_template("hlpas.html", **context)


@checker.route("/legal-aid-available")
def interstitial():
"""
Expand Down
1 change: 1 addition & 0 deletions cla_public/apps/scope/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def get(self, choices="", *args, **kwargs):
is_hlpas = "no"

outcome_url[1]["hlpas"] = is_hlpas
session.store(dict(hlpas=is_hlpas))

if state == DIAGNOSIS_SCOPE.OUTOFSCOPE:
category = self.get_category_for_larp(session)
Expand Down
265 changes: 0 additions & 265 deletions cla_public/templates/checker/result/_find-legal-adviser.html

This file was deleted.

2 changes: 1 addition & 1 deletion cla_public/templates/checker/result/face-to-face.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% block inner_content %}

{% with postcode_info=postcode_info %}
{% include "checker/result/_find-legal-adviser.html" %}
{% include "checker/result/find-legal-adviser-search/index.html" %}
{% endwith %}

{% include "checker/time-out-warning.html" %}
Expand Down

0 comments on commit c817266

Please sign in to comment.