Skip to content

Commit

Permalink
Merge branch 'dev' into close-query-form-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saruniitr committed Feb 9, 2024
2 parents ec5f7fe + d4243c7 commit d059808
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 0 deletions.
5 changes: 5 additions & 0 deletions caseworker/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ <h2 class="govuk-visually-hidden">Support links</h2>
</a>
</li>
{% endif %}
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/accessibility-statement">
Accessibility statement
</a>
</li>
</ul>

<span class="govuk-footer__licence-description">
Expand Down
7 changes: 7 additions & 0 deletions caseworker/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import caseworker.core.views

from core.accessibility.views import CaseworkerAccessibilityStatementView


urlpatterns = [
path("healthcheck/", include("health_check.urls")),
Expand All @@ -27,6 +29,11 @@
path("tau/report_summary/", include("caseworker.report_summary.urls")),
path("search/", include("caseworker.search.urls")),
path("bookmarks/", include("caseworker.bookmarks.urls")),
path(
"accessibility-statement/",
CaseworkerAccessibilityStatementView.as_view(),
name="caseworker-accessibility-statement",
),
]


Expand Down
29 changes: 29 additions & 0 deletions core/accessibility/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from django.views.generic import TemplateView
from django.urls import reverse

from core.auth.views import LoginRequiredMixin


class BaseAccessibilityStatementView(LoginRequiredMixin, TemplateView):
template_name = "accessibility/accessibility.html"

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
protocol = "https://" if self.request.is_secure() else "http://"
context["host"] = f"{protocol}{self.request.get_host()}/"
return context


class ExporterAccessibilityStatementView(BaseAccessibilityStatementView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["back_url"] = reverse("core:home")
return context


class CaseworkerAccessibilityStatementView(BaseAccessibilityStatementView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["back_url"] = reverse("core:index")

return context
111 changes: 111 additions & 0 deletions core/templates/accessibility/accessibility.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{% extends 'layouts/base.html' %}

{% block back_link %}
<a href="{{ back_url }}" class="govuk-back-link">Back</a>
{% endblock %}

{% block title %}Accessibility statement{% endblock %}

{% block body %}
<div class="govuk-width-container">
<main id="main-content" class="govuk-main-wrapper govuk-!-padding-top-0">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Accessibility statement
</h1>

<p class="govuk-body">
This statement applies to {{ host }}
</p>
<p class="govuk-body">
This service is run by the Department for Business and Trade (DBT). It is currently in private beta
but is designed to be used by as many people as possible when it goes into public beta for
standard individual export licences (SIELs).
</p>
<p class="govuk-body">
<a class="govuk-link govuk-link--no-visited-state"
href="https://mcmw.abilitynet.org.uk/">AbilityNet</a> has advice on making your device easier to
use if you have a disability.
</p>

<h2 class="govuk-heading-m">How accessible this website is</h2>
<p class="govuk-body">
The service meets the Content Accessibility Guidelines (WCAG) version 2.1 AA standard.
</p>
<p class="govuk-body">
The below areas do not meet 2.1 AAA requirements, which were not in scope for the purposes of
this audit:
<ul class="govuk-list govuk-list--bullet">
<li>there was an ambiguous link identified on two pages that may be difficult to understand for
screen reader users browsing out of context</li>
<li>links that opened in a new window without informing users were identified</li>
</ul>
</p>

<h2 class="govuk-heading-m">Feedback and contact information</h2>
<p class="govuk-body">
If you find any problems not listed on this page or think we do not meet accessibility requirements,
contact <a class="govuk-link govuk-link--no-visited-state"
href=mailto:[email protected]>[email protected]</a>.
</p>
<p class="govuk-body">
We’ll consider your request and get back to you within 15 days.
</p>

<h2 class="govuk-heading-m">Enforcement procedure</h2>
<p class="govuk-body">
The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public
Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the
'accessibility regulations'). If you're not happy with how we respond to your complaint, <a
class="govuk-link govuk-link--no-visited-state"
href="https://www.gov.uk/equality-advisory-support-service/">contact the
Equality Advisory and Support Service (EASS)</a>.
</p>

<h2 class="govuk-heading-m">Technical information about this website's accessibility</h2>
<p class="govuk-body">
We are committed to making this website accessible, in accordance with the Public Sector Bodies
(Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.
</p>

<h3 class="govuk-heading-s">Compliance status</h3>
<p class="govuk-body">
This website is fully compliant with the <a class="govuk-link govuk-link--no-visited-state"
href="https://www.w3.org/TR/WCAG21/">Web Content
Accessibility Guidelines version 2.1 AA standard</a>.
</p>

<h3 class="govuk-heading-s">Content that’s not within the scope of the accessibility regulations</h3>
<p class="govuk-body">
Our PDF documents are essential to providing our services. For example, we have PDFs with
information on the application outcome and a copy of the application is generated as a PDF.
</p>

<h2 class="govuk-heading-m">What we're doing to improve accessibility</h2>
<p class="govuk-body">
We will schedule another accessibility audit in late 2024 to identify any issues that do not meet
the WCAG 2.2. success criteria.
</p>
<p class="govuk-body">
In late 2024, we will consider what we can do to improve the accessibility of our PDF documents
and licences.
</p>

<h2 class="govuk-heading-m">Preparation of this accessibility statement</h2>
<p class="govuk-body">
This statement was prepared on Friday 2 February 2024. It was last reviewed on Friday 2
February 2024.
</p>
<p class="govuk-body">
This website was last tested on 30 May 2023 and was checked for compliance with the WCAG 2.1
AA standard. The test was carried out by the <a class="govuk-link govuk-link--no-visited-state"
href="https://digitalaccessibilitycentre.org/">Digital Accessibility Centre (DAC)</a>.
</p>

</div>
</div>
</main>
</div>

{% endblock %}
5 changes: 5 additions & 0 deletions exporter/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ <h2 class="govuk-visually-hidden">Support links</h2>
</a>
</li>
{% endif %}
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/accessibility-statement">
Accessibility statement
</a>
</li>
</ul>

<svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 483.2 195.7" height="17" width="41">
Expand Down
7 changes: 7 additions & 0 deletions exporter/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import exporter.core.views

from core.accessibility.views import ExporterAccessibilityStatementView


urlpatterns = [
path("healthcheck/", include("health_check.urls")),
Expand All @@ -26,6 +28,11 @@
path("", include("exporter.hmrc.urls")),
path("feedback/", include("core.feedback.urls")),
path("cookies/", include("core.cookies.urls")),
path(
"accessibility-statement/",
ExporterAccessibilityStatementView.as_view(),
name="exporter-accessibility-statement",
),
]

if settings.MOCK_SSO_ACTIVATE_ENDPOINTS:
Expand Down
17 changes: 17 additions & 0 deletions unit_tests/caseworker/core/test_views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from bs4 import BeautifulSoup
from django.urls import reverse
from pytest_django.asserts import assertTemplateUsed


def test_caseworker_accessibility_statement_view(authorized_client):
response = authorized_client.get(reverse("caseworker-accessibility-statement"))

assert response.status_code == 200
assertTemplateUsed(response, "accessibility/accessibility.html")

soup = BeautifulSoup(response.content, "html.parser")
assert soup.find("h1").string.strip() == "Accessibility statement"
assert soup.title.string.strip() == "Accessibility statement - LITE Internal"

expected_back_url = reverse("core:index")
assert response.context["back_url"] == expected_back_url
14 changes: 14 additions & 0 deletions unit_tests/exporter/core/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,17 @@ def test_survey_alert_not_displayed(authorized_client, settings, home_url, mock_

banner = soup.select("#survey-notification-banner")
assert not banner


def test_exporter_accessibility_statement_view(authorized_client):
response = authorized_client.get(reverse("exporter-accessibility-statement"))

assert response.status_code == 200
assertTemplateUsed(response, "accessibility/accessibility.html")

soup = BeautifulSoup(response.content, "html.parser")
assert soup.find("h1").string.strip() == "Accessibility statement"
assert soup.title.string.strip() == "Accessibility statement - LITE - GOV.UK"

expected_back_url = reverse("core:home")
assert response.context["back_url"] == expected_back_url

0 comments on commit d059808

Please sign in to comment.