Skip to content

Commit 4d2c361

Browse files
committed
Add SEND category
1 parent 3bd8aa3 commit 4d2c361

File tree

8 files changed

+148
-1
lines changed

8 files changed

+148
-1
lines changed

app/categories/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from .housing import bp as housing_bp
66
from .mental_capacity import bp as mental_capacity_bp
77
from .community_care import bp as community_care_bp
8+
from .send import bp as send_bp
9+
810
from .results import bp as results_bp
911

1012
bp = Blueprint("categories", __name__)
@@ -15,5 +17,6 @@
1517
bp.register_blueprint(results_bp)
1618
bp.register_blueprint(asylum_immigration_bp)
1719
bp.register_blueprint(community_care_bp)
20+
bp.register_blueprint(send_bp)
1821

1922
from app.categories import urls # noqa: E402,F401

app/categories/send/__init__.py

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

app/categories/send/forms.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from app.categories.forms import SafeguardingQuestionForm
2+
3+
4+
class WorriedAboutSomeonesSafetyForm(SafeguardingQuestionForm):
5+
category = "Domestic Abuse"

app/categories/send/urls.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from app.categories.send import bp
2+
from app.categories.views import CategoryLandingPage
3+
4+
5+
class SendLandingPage(CategoryLandingPage):
6+
question_title = "Special educational needs and disability (SEND)"
7+
8+
category = "send"
9+
10+
routing_map = {
11+
"child_young_person": "categories.index",
12+
"tribunals": "categories.index",
13+
"child_in_care": "categories.index",
14+
"discrimination": "categories.results.in_scope",
15+
"schools": "categories.results.in_scope",
16+
"disability": "categories.index",
17+
"other": "categories.results.refer",
18+
}
19+
20+
21+
bp.add_url_rule(
22+
"/send/",
23+
view_func=SendLandingPage.as_view(
24+
"landing", template="categories/send/landing.html"
25+
),
26+
)
27+
28+
SendLandingPage.register_routes(blueprint=bp)

app/templates/categories/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h2 class="govuk-heading-m govuk-!-margin-bottom-4">Most searched problems</h2>
4949

5050
{{ list_item_arrow("Special educational needs and disability (SEND)",
5151
"Help if your child has SEND.",
52-
url_for("categories.index")) }}
52+
url_for("categories.send.landing")) }}
5353
</div>
5454

5555
<br>
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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 %}Special educational needs and disability (SEND){% 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 %}Special educational needs and disability (SEND){% endtrans %}</h1>
25+
26+
{{ list_item(_("Help with a child or young person's SEND)"),
27+
_("Help with schools, other education settings and local authorities. Includes help with education, health and care plans (EHCP) or if a child’s needs are not being met."),
28+
url_for("categories.send.child_young_person")) }}
29+
30+
{{ list_item(_("SEND tribunals"),
31+
_("Applying for or going to a SEND tribunal, appealing a decision by a tribunal."),
32+
url_for("categories.send.tribunals")) }}
33+
34+
{{ list_item(_("Child treated unfairly at school, discrimination"),
35+
_("If a child is treated unfairly at school because of their disability. Or if you were treated badly for complaining about this."),
36+
url_for("categories.send.discrimination")) }}
37+
38+
<br>
39+
40+
<h2 class="govuk-heading-m">{% trans %}More problems{% endtrans %}</h2>
41+
42+
<br>
43+
44+
{{ list_item_small(_("Other problems with schools"),
45+
_("Advice about legal action against a school. Includes if a child is out of school, exclusions, transport to school, judicial reviews."),
46+
url_for("categories.send.schools")) }}
47+
48+
{{ list_item_small(_("Care needs for disability (social care)"),
49+
_("Problems getting the local authority or council to provide or pay for the right care. For carers, children, young people and adults."),
50+
url_for("categories.send.disability")) }}
51+
{{ cannot_find_your_problem(_("SEND"), url_for("categories.send.other"))}}
52+
53+
</div>
54+
</div>
55+
{% endblock %}

tests/functional_tests/categories/send/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from playwright.sync_api import Page, expect
2+
import pytest
3+
4+
child_in_care_heading = "Find problems covered by legal aid"
5+
legaild_aid_available_heading = "Legal aid is available for this type of problem"
6+
ROUTING = [
7+
{
8+
"link_text": "Help with a child or young person's SEND",
9+
"next_page_heading": child_in_care_heading,
10+
},
11+
{
12+
"link_text": "SEND tribunals",
13+
"next_page_heading": child_in_care_heading,
14+
},
15+
{
16+
"link_text": "Child treated unfairly at school, discrimination",
17+
"next_page_heading": legaild_aid_available_heading,
18+
},
19+
{
20+
"link_text": "Other problems with schools",
21+
"next_page_heading": legaild_aid_available_heading,
22+
},
23+
{
24+
"link_text": "Care needs for disability (social care)",
25+
"next_page_heading": child_in_care_heading,
26+
},
27+
{"link_text": "Next steps to get help", "next_page_heading": "Referral page"},
28+
]
29+
30+
31+
@pytest.mark.usefixtures("live_server")
32+
class TestSendLandingPage:
33+
@pytest.mark.parametrize("routing", ROUTING)
34+
def test_onward_routing(self, page: Page, routing: dict):
35+
page.get_by_role(
36+
"link", name="Special educational needs and disability (SEND)"
37+
).click()
38+
page.get_by_role("link", name=routing["link_text"]).click()
39+
40+
next_page_heading = routing["next_page_heading"]
41+
next_page_heading = (
42+
next_page_heading
43+
if isinstance(next_page_heading, list)
44+
else [next_page_heading]
45+
)
46+
for page_heading in next_page_heading:
47+
expect(page.get_by_text(page_heading)).to_be_visible()

0 commit comments

Comments
 (0)