Skip to content

Commit 3bd8aa3

Browse files
authored
Add care in the community category (#69)
1 parent c48f028 commit 3bd8aa3

File tree

8 files changed

+169
-3
lines changed

8 files changed

+169
-3
lines changed

app/categories/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .asylum_immigration import bp as asylum_immigration_bp
55
from .housing import bp as housing_bp
66
from .mental_capacity import bp as mental_capacity_bp
7+
from .community_care import bp as community_care_bp
78
from .results import bp as results_bp
89

910
bp = Blueprint("categories", __name__)
@@ -13,5 +14,6 @@
1314
bp.register_blueprint(mental_capacity_bp)
1415
bp.register_blueprint(results_bp)
1516
bp.register_blueprint(asylum_immigration_bp)
17+
bp.register_blueprint(community_care_bp)
1618

1719
from app.categories import urls # noqa: E402,F401
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from flask import Blueprint
2+
3+
bp = Blueprint(
4+
"community_care",
5+
__name__,
6+
template_folder="./templates",
7+
)
8+
9+
from app.categories.community_care import urls # noqa: E402,F401

app/categories/community_care/urls.py

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from app.categories.community_care import bp
2+
from app.categories.views import CategoryLandingPage
3+
4+
CATEGORY_NAME = "community_care"
5+
6+
FALA_REDIRECT = {
7+
"endpoint": "find-a-legal-adviser.search",
8+
"category": "com",
9+
}
10+
11+
12+
class CommunityCareLandingPage(CategoryLandingPage):
13+
question_title = CATEGORY_NAME
14+
15+
category = CATEGORY_NAME
16+
17+
routing_map = {
18+
"care_from_council": FALA_REDIRECT,
19+
"carer": FALA_REDIRECT,
20+
"receive_care_in_own_home": FALA_REDIRECT,
21+
"care_or_funding_stops": FALA_REDIRECT,
22+
"placement_care_homes_care_housing": FALA_REDIRECT,
23+
"problems_with_quality_of_care": FALA_REDIRECT,
24+
"care_leaver": FALA_REDIRECT,
25+
"other": "categories.results.refer",
26+
}
27+
28+
29+
bp.add_url_rule(
30+
"/community-care/",
31+
view_func=CommunityCareLandingPage.as_view(
32+
"landing", template="categories/community_care/landing.html"
33+
),
34+
)
35+
36+
CommunityCareLandingPage.register_routes(blueprint=bp)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{% extends "base.html" %}
2+
{%- from 'govuk_frontend_jinja/components/back-link/macro.html' import govukBackLink -%}
3+
{%- from 'govuk_frontend_jinja/components/exit-this-page/macro.html' import govukExitThisPage -%}
4+
{%- from 'categories/components/list-item.html' import list_item, list_item_small -%}
5+
{%- from 'categories/components/cannot-find-your-problem.html' import cannot_find_your_problem -%}
6+
7+
{% block pageTitle %}{% trans %}Care needs for disability and old age (social care){% endtrans %} - GOV.UK{% endblock %}
8+
9+
{% block beforeContent%}
10+
{{ super() }}
11+
{{ govukBackLink({
12+
'href': url_for('categories.index'),
13+
'text': "Back"
14+
}) }}
15+
16+
{% endblock %}
17+
18+
{% block content %}
19+
20+
{{ super() }}
21+
22+
<div class="govuk-grid-row">
23+
<div class="govuk-grid-column-two-thirds">
24+
<h1 class="govuk-heading-xl">{% trans %}Care needs for disability and old age (social care){% endtrans %}</h1>
25+
26+
{{ list_item(_("Care from the council (local authority)"),
27+
_("Includes problems with care needs assessments, financial assessments and care support plans. Getting an advocate for assessments. Problems with transport, personal budgets and direct payments."),
28+
url_for("categories.community_care.care_from_council")) }}
29+
30+
{{ list_item(_("If you’re a carer"),
31+
_("Includes problems with carer’s assessments and respite care. Problems to do with making decisions about someone’s care."),
32+
url_for("categories.community_care.carer")) }}
33+
34+
{{ list_item(_("If you receive care in your own home"),
35+
_("Problems with care providers, social workers, care agencies. Also getting adaptations and disabled facilities grants."),
36+
url_for("categories.community_care.receive_care_in_own_home")) }}
37+
38+
{{ list_item(_("If care or funding stops"),
39+
_("Problems if care or money for care is stopped or reduced, or if care facilities close."),
40+
url_for("categories.community_care.care_or_funding_stops")) }}
41+
42+
{{ list_item(_("Placements, care homes and care housing"),
43+
_("Problems with placements in care homes, group homes or other supported housing. If a placement isn't working because someone's care needs have changed."),
44+
url_for("categories.community_care.placement_care_homes_care_housing")) }}
45+
46+
{{ list_item(_("Problems with the quality of care, safeguarding"),
47+
_("Issues with safeguarding, abuse, neglect, or care that is not good enough. This includes in group homes or other placements, or from a carer or social worker."),
48+
url_for("categories.community_care.problems_with_quality_of_care")) }}
49+
50+
{{ list_item(_("If you’re a care leaver"),
51+
_("Problems if the local authority is not providing the right support. Includes problems with housing, financial support, education, personal advisers and Pathway Plans."),
52+
url_for("categories.community_care.care_leaver")) }}
53+
54+
<br>
55+
56+
<h2 class="govuk-heading-m">{% trans %}More problems{% endtrans %}</h2>
57+
58+
<br>
59+
60+
{{ cannot_find_your_problem(_("community care"), url_for("categories.community_care.other"))}}
61+
62+
</div>
63+
</div>
64+
{% endblock %}

app/templates/categories/housing/landing.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h1 class="govuk-heading-xl">{% trans %}Housing, homelessness, losing your home{
4444
url_for("categories.housing.council_housing")) }}
4545
<br>
4646

47-
<h2 class="govuk-heading-m">{% trans%}More problems{% endtrans %}</h2>
47+
<h2 class="govuk-heading-m">{% trans %}More problems{% endtrans %}</h2>
4848

4949
<br>
5050

@@ -65,7 +65,7 @@ <h2 class="govuk-heading-m">{% trans%}More problems{% endtrans %}</h2>
6565
url_for("categories.housing.anti_social")) }}
6666

6767

68-
{{ cannot_find_your_problem("housing", url_for("categories.housing.other"))}}
68+
{{ cannot_find_your_problem(_("housing"), url_for("categories.housing.other"))}}
6969

7070
</div>
7171
</div>

app/templates/categories/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h3 class="govuk-heading-m">Other problems covered by legal aid</h3>
7474

7575
{{ list_item_small("Care for old age, health issues or disability",
7676
"Problems with social care. Neglect and bad-quality care. This includes getting care from the council or local authority, paying for care, care homes and other residential homes.",
77-
url_for("categories.index")) }}
77+
url_for("categories.community_care.landing")) }}
7878

7979
{{ list_item_small("Mental capacity, mental health",
8080
"Help if someone cannot make decisions about their health, day-to-day life or care. Help at mental health tribunals.",

tests/functional_tests/categories/community_care/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from playwright.sync_api import Page, expect
2+
import pytest
3+
4+
fala_page_heading = ["Find a legal adviser", "community care"]
5+
6+
ROUTING = [
7+
{
8+
"link_text": "Care from the council (local authority)",
9+
"next_page_heading": fala_page_heading,
10+
},
11+
{
12+
"link_text": "If you’re a carer",
13+
"next_page_heading": fala_page_heading,
14+
},
15+
{
16+
"link_text": "If you receive care in your own home",
17+
"next_page_heading": fala_page_heading,
18+
},
19+
{
20+
"link_text": "If care or funding stops",
21+
"next_page_heading": fala_page_heading,
22+
},
23+
{
24+
"link_text": "Placements, care homes and care housing",
25+
"next_page_heading": fala_page_heading,
26+
},
27+
{
28+
"link_text": "Problems with the quality of care, safeguarding",
29+
"next_page_heading": fala_page_heading,
30+
},
31+
{
32+
"link_text": "If you’re a care leaver",
33+
"next_page_heading": fala_page_heading,
34+
},
35+
{"link_text": "Next steps to get help", "next_page_heading": "Referral page"},
36+
]
37+
38+
39+
@pytest.mark.usefixtures("live_server")
40+
class TestHousingLandingPage:
41+
@pytest.mark.parametrize("routing", ROUTING)
42+
def test_onward_routing(self, page: Page, routing: dict):
43+
page.get_by_role(
44+
"link", name="Care for old age, health issues or disability"
45+
).click()
46+
page.get_by_role("link", name=routing["link_text"]).click()
47+
48+
next_page_heading = routing["next_page_heading"]
49+
next_page_heading = (
50+
next_page_heading
51+
if isinstance(next_page_heading, list)
52+
else [next_page_heading]
53+
)
54+
for page_heading in next_page_heading:
55+
expect(page.get_by_text(page_heading)).to_be_visible()

0 commit comments

Comments
 (0)