Skip to content

Commit

Permalink
Merge pull request #1790 from uktrade/uat
Browse files Browse the repository at this point in the history
Production release
  • Loading branch information
kevincarrogan authored Feb 15, 2024
2 parents 66e1fae + 8acd90a commit 26da1af
Showing 20 changed files with 650 additions and 11 deletions.
6 changes: 4 additions & 2 deletions caseworker/cases/forms/queries.py
Original file line number Diff line number Diff line change
@@ -8,10 +8,12 @@ class CloseQueryForm(forms.Form):
reason_for_closing_query = forms.CharField(
label="Why are you closing the query? This will not be visible to the exporter.",
widget=forms.Textarea,
required=False,
error_messages={"required": "Enter a reason why you are closing the query"},
)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.layout = Layout("reason_for_closing_query", Button("submit", "Submit"))
self.helper.layout = Layout(
"reason_for_closing_query", Button("submit", "Submit", css_class="govuk-!-margin-bottom-0")
)
2 changes: 1 addition & 1 deletion caseworker/cases/helpers/case.py
Original file line number Diff line number Diff line change
@@ -239,7 +239,7 @@ def _transform_data(self):
for queue_detail in self.case.queue_details:
queue_detail["days_on_queue_elapsed"] = (timezone.now() - parse(queue_detail["joined_queue_at"])).days

def get(self, request, **kwargs):
def get(self, request, *args, **kwargs):
self.case_id = str(kwargs["pk"])
self.case = get_case(request, self.case_id)
self.queue_id = kwargs["queue_pk"]
22 changes: 22 additions & 0 deletions caseworker/cases/views/queries.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from django.http import Http404
from django.urls import reverse
from django.views.generic import FormView

from caseworker.cases.forms.queries import CloseQueryForm
from caseworker.cases.helpers.ecju_queries import get_ecju_queries
from caseworker.cases.services import put_ecju_query
from core.auth.views import LoginRequiredMixin


class CloseQueryView(LoginRequiredMixin, FormView):
form_class = CloseQueryForm
template_name = "case/close-query.html"

def dispatch(self, request, *args, **kwargs):
self.lite_user = request.lite_user
@@ -35,3 +38,22 @@ def get_success_url(self):
"tab": "ecju-queries",
},
)

def get_query(self, open_ecju_queries):
for query in open_ecju_queries:
if query["id"] == str(self.kwargs["query_pk"]):
return query
return None

def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)

open_ecju_queries, _ = get_ecju_queries(self.request, self.kwargs["pk"])
query = self.get_query(open_ecju_queries)
if not query:
raise Http404

context["title"] = "Close query"
context["query"] = query

return context
35 changes: 35 additions & 0 deletions caseworker/templates/case/close-query.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends 'layouts/two-pane.html' %}
{% load crispy_forms_tags crispy_forms_gds %}

{% block title %}{{title}}{% endblock %}
{% block back_link %}
<a href="{{ back_link_url }}" id="back-link" class="govuk-back-link">{{ back_link_text|default:"Back" }}</a>
{% endblock %}

{% block two_thirds %}

{% if errors %}
{% include "forms-errors.html" %}
{% endif %}

<form action="{{ form_action_url }}" method="post" enctype="multipart/form-data">
{% csrf_token %}

{% error_summary form %}

<div class="govuk-body">
<h1 class="govuk-label-wrapper">
<label class="govuk-label--l">
Close query
</label>
</h1>
<div class=" govuk-!-padding-top-3 govuk-!-padding-bottom-3">
<div class="app-ecju-query__text">
{{ query.question }}
</div>
</div>
{% crispy form %}
</div>
</form>

{% endblock %}
5 changes: 5 additions & 0 deletions caseworker/templates/layouts/base.html
Original file line number Diff line number Diff line change
@@ -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">
7 changes: 7 additions & 0 deletions caseworker/urls.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@

import caseworker.core.views

from core.accessibility.views import CaseworkerAccessibilityStatementView


urlpatterns = [
path("healthcheck/", include("health_check.urls")),
@@ -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",
),
]


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 <a class="govuk-link govuk-link--no-visited-state" href="{{ host }}">{{ host }}</a>
</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 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 %}
1 change: 1 addition & 0 deletions exporter/core/urls.py
Original file line number Diff line number Diff line change
@@ -50,5 +50,6 @@
path("signature-help/", views.SignatureHelp.as_view(), name="signature_help"),
path("certificate/", views.CertificateDownload.as_view(), name="certificate"),
path("register-name/", views.RegisterName.as_view(), name="register_name"),
path("privacy-notice/", views.PrivacyNotice.as_view(), name="privacy_notice"),
]
)
4 changes: 4 additions & 0 deletions exporter/core/views.py
Original file line number Diff line number Diff line change
@@ -226,3 +226,7 @@ def get(self, request, *args, **kwargs):

def handler403(request, exception):
return error_page(request, title="Forbidden", description=exception, show_back_link=True)


class PrivacyNotice(LoginRequiredMixin, TemplateView):
template_name = "core/privacy_notice.html"
Loading

0 comments on commit 26da1af

Please sign in to comment.