Skip to content

Commit

Permalink
ICMSLST-2786 - Validate Signature Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuspp committed Sep 2, 2024
1 parent 205a88a commit 3a95de7
Show file tree
Hide file tree
Showing 66 changed files with 626 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ ilb_admin.json
/generated_pdfs/
/python_version.txt
/.env.no-docker
.DS_Store
3 changes: 3 additions & 0 deletions pii-ner-exclude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4959,3 +4959,6 @@ COVER_FIREARMS_SEC5_NOT_EU
Spanish CFS Schedule
TemplateCodes
CaseEmail Records
noreferrer">DIT
25th September 2024
web.support.urls
4 changes: 3 additions & 1 deletion pii-secret-exclude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data_migration/management/commands/fixtures/
.circleci/config.yml
web/static/web/js/pdf/paged.polyfill.js
web/static/web/docs/DIT-DBT-NameChangeNotification.pdf
web/templates/web/accessibility_statement.html
web/templates/web/support/accessibility_statement.html
web/static/web/docs/PrivacyNotice.pdf
web/tests/utils/pdf/test_visual_regression/benchmark_pdfs/cfs_certificate.pdf
web/tests/utils/pdf/test_visual_regression/benchmark_pdfs/cfs_cover_letter.pdf
Expand All @@ -55,3 +55,5 @@ web/tests/utils/pdf/test_visual_regression/benchmark_pdfs/oil_long_licence.pdf
web/tests/utils/pdf/test_visual_regression/benchmark_pdfs/oil_paper_licence_only.pdf
web/tests/utils/pdf/test_visual_regression/benchmark_pdfs/sil_long_licence.pdf
web/tests/utils/pdf/test_visual_regression/benchmark_pdfs/sil_paper_licence_only.pdf
web/templates/web/support/signatures/validate_v1.html
web/templates/web/support/signatures/validate_v2.html
4 changes: 3 additions & 1 deletion web/mail/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ def get_context(self) -> dict[str, Any]:
context = super().get_context()
return context | {
"reference": self.application.reference,
"validate_digital_signatures_url": get_validate_digital_signatures_url(full_url=True),
"validate_digital_signatures_url": get_validate_digital_signatures_url(
self.get_site_domain()
),
"application_url": get_case_view_url(self.application, self.get_site_domain()),
}

Expand Down
8 changes: 2 additions & 6 deletions web/mail/url_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from django.http import QueryDict
from django.shortcuts import reverse
from django.templatetags.static import static

from web.domains.case.types import Authority, DocumentPack, ImpOrExp
from web.models import (
Expand All @@ -28,11 +27,8 @@
)


def get_validate_digital_signatures_url(full_url: bool = False) -> str:
url = static("web/docs/ValidateDigSigs.pdf")
if full_url:
return urljoin(get_importer_site_domain(), url)
return url
def get_validate_digital_signatures_url(domain: str) -> str:
return urljoin(domain, reverse("support:validate-signature"))


def get_case_view_url(application: ImpOrExp, domain: str) -> str:
Expand Down
12 changes: 12 additions & 0 deletions web/static/web/css/pages/help-validate-signatures.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.cert-help {
padding: 1em;
text-align: center
}

.cert-help img {
max-width: 600px;
}

.date-icon {
padding: 0.2em 0.3em;
}
Binary file removed web/static/web/docs/ValidateDigSigs.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added web/support/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions web/support/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django import forms

from web.forms.fields import JqueryDateField


class ValidateSignatureForm(forms.Form):
date_issued = JqueryDateField(required=True, label="What date was your document issued")
39 changes: 39 additions & 0 deletions web/support/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from django.urls import path

from .views import (
AccessibilityStatementView,
SupportLandingView,
ValidateSignatureV1View,
ValidateSignatureV2View,
ValidateSignatureView,
)

app_name = "support"

urlpatterns = [
path(
"",
SupportLandingView.as_view(),
name="landing",
),
path(
"accessibility-statement/",
AccessibilityStatementView.as_view(),
name="accessibility-statement",
),
path(
"validate-signature/",
ValidateSignatureView.as_view(),
name="validate-signature",
),
path(
"validate-signature/v1/",
ValidateSignatureV1View.as_view(),
name="validate-signature-v1",
),
path(
"validate-signature/v2/",
ValidateSignatureV2View.as_view(),
name="validate-signature-v2",
),
]
39 changes: 39 additions & 0 deletions web/support/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import datetime as dt

from django.http import HttpResponse
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import FormView, TemplateView

from .forms import ValidateSignatureForm


class AccessibilityStatementView(TemplateView):
http_method_names = ["get"]
template_name = "web/support/accessibility_statement.html"


class SupportLandingView(TemplateView):
http_method_names = ["get"]
template_name = "web/support/index.html"


class ValidateSignatureView(FormView):
form_class = ValidateSignatureForm
template_name = "web/support/signatures/validate.html"

def form_valid(self, form: ValidateSignatureForm) -> HttpResponse:
date_issued = form.cleaned_data["date_issued"]
if date_issued >= dt.date(2024, 9, 26):
return redirect(reverse("support:validate-signature-v2"))
return redirect(reverse("support:validate-signature-v1"))


class ValidateSignatureV1View(TemplateView):
http_method_names = ["get"]
template_name = "web/support/signatures/validate_v1.html"


class ValidateSignatureV2View(TemplateView):
http_method_names = ["get"]
template_name = "web/support/signatures/validate_v2.html"
2 changes: 1 addition & 1 deletion web/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2 class="govuk-cookie-banner__heading govuk-heading-m">
<footer>
{% block footer %}
<div class="footer-link">
<a href="{{ icms_url('accessibility-statement') }}" target="_blank">Accessibility Statement</a>
<a href="{{ icms_url('support:landing') }}" target="_blank">Help and support</a>
</div>
{% endblock %}
</footer>
Expand Down
2 changes: 1 addition & 1 deletion web/templates/layout/public.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
, except where otherwise stated. <a href="{{ static('web/docs/PrivacyNotice.pdf') }}" class="pdf" target="_blank" rel="noopener noreferrer">Fair Processing Notice</a>
<br><br>
<a href="{{ icms_url('cookie-consent') }}?referrer_url={{ request.path }}">Cookies</a>
<a href="{{ icms_url('accessibility-statement') }}" target="_blank" rel="noopener noreferrer">Accessibility Statement</a>
<a href="{{ icms_url('support:accessibility-statement') }}" target="_blank" rel="noopener noreferrer">Accessibility Statement</a>
</div>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{% extends "layout/sidebar.html" %}
{% extends "web/support/index.html" %}

{% block context_header %}Apply for an import licence or export certificate accessibility statement{% endblock %}
{% block context_header %}{{ request.site.name }} accessibility statement{% endblock %}

{% block page_title %}Apply for an import licence or export certificate accessibility statement{% endblock %}
{% block page_title %}{{ request.site.name }} accessibility statement{% endblock %}

{% block main_content %}

{% block content %}
<div id="wrapper">
<div id="content">
<div class=content-ie8-float">
<div class="row">
<p>This accessibility statement applies to the service Apply for an import licence and export certificate.</p>
<p>This accessibility statement applies to the service {{ request.site.name }}.</p>
<p>The Department for Business and Trade (DBT) wants to make the service accessible for all and must do so to comply with rules set out by The Equality and Human Rights Commission (EHRC), responsible for enforcing the Public Sector Bodies Accessibility Regulations 2018.</p>
<p>Users should be able to:</p>
<ul>
Expand Down Expand Up @@ -42,9 +40,7 @@ <h4>Preparation of this accessibility statement</h4>
<p>This statement was prepared on 4th September 2024. It was last reviewed on 1st July 2024.</p>
<p>This website was last tested on 10th of August 2023. The test was carried out by DAC (Digital Accessibility Centre). </p>
</div>
</div>
</div>
</div>

{% endblock %}

{% block footer %}{% endblock %}
17 changes: 17 additions & 0 deletions web/templates/web/support/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "layout/sidebar.html" %}


{% block context_header %}
Help and support
{% endblock %}

{% block sidebar %}
{% include "web/support/partial/sidebar.html" %}
{% endblock %}

{% block main_content %}
<h5>Help and support</h5>
<p>Find important information including our accessibility statement and how to validate digital signatures.</p>
{% endblock %}

{% block footer %}{% endblock %}
19 changes: 19 additions & 0 deletions web/templates/web/support/partial/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<ul class="menu-out">
<h5>Digital Signatures</h5>
<li>
<a href="{{ icms_url('support:validate-signature') }}">How to validate a signature on a digitally signed document</a>
</li>
<h5>Useful Links</h5>
<li>
<a href="{{ icms_url('support:accessibility-statement') }}">Accessibility Statement</a>
</li>
<li>
<a href="{{ static('web/docs/PrivacyNotice.pdf') }}" class="pdf" target="_blank" rel="noopener noreferrer">Fair Processing Notice</a>
</li>
<li>
<a href="{{ static('web/docs/DIT-DBT-NameChangeNotification.pdf') }}" target="_blank" rel="noopener noreferrer">DIT to DBT Notification Document</a>
</li>
<li>
<a href="{{ icms_url('cookie-consent') }}?referrer_url={{ request.path }}">Cookies</a>
</li>
</ul>
28 changes: 28 additions & 0 deletions web/templates/web/support/signatures/validate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% extends "web/support/index.html" %}

{% block context_header %}How to validate a signature on a digitally signed document{% endblock %}

{% block page_title %}How to validate a signature on a digitally signed document{% endblock %}

{% block css %}
{{ super() }}
<link rel="stylesheet" type="text/css" href="{{ static('web/css/pages/help-validate-signatures.css') }}">
{% endblock %}

{% block main_content %}

<div class="row">
<form action="" method="post" class="column four">
{{ csrf_input }}
{{ form.as_p() }}
<input
type="submit"
class="primary-button button"
value="Submit"
>
</form>
</div>

{% endblock %}

{% block footer %}{% endblock %}
Loading

0 comments on commit 3a95de7

Please sign in to comment.