mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-06 17:09:00 -04:00
Merge pull request #3296 from alphagov/add-letter-specification-guidance
Add letter specification guidance
This commit is contained in:
@@ -21,8 +21,25 @@
|
||||
<li>Select <b class="govuk-!-font-weight-bold">Choose file</b>.</li>
|
||||
</ol>
|
||||
|
||||
<p>Use the <a href="{{ url_for('.letter_spec') }}">letter specification document</a> to help you set up your letter.<p>
|
||||
<h2 class="heading-medium" id="letter-specification">Letter specification</h2>
|
||||
|
||||
<p>Your file must be:</p>
|
||||
|
||||
<ul class="list list-bullet">
|
||||
<li>a PDF</li>
|
||||
<li>A4 portrait size (210 × 297 mm)</li>
|
||||
<li>10 pages or less</li>
|
||||
<li>smaller than 2MB</li>
|
||||
</ul>
|
||||
|
||||
<p>The content of your letter must appear inside the printable area.</p>
|
||||
|
||||
<p>To help you set up your letter, you can download:</p>
|
||||
|
||||
<ul class="list list-bullet">
|
||||
<li>our <a href="{{ url_for('.letter_spec') }}">letter specification document (PDF)</a></li>
|
||||
<li>a <a href="https://docs.notifications.service.gov.uk/documentation/images/notify-pdf-letter-word-template-v1.0.docx">Microsoft Word document template (.docx)</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
)}}
|
||||
</p>
|
||||
<p>You can upload a single letter as a PDF.</p>
|
||||
<p>Your file must meet our <a href="{{ url_for('.letter_spec') }}">letter specification</a>.</p>
|
||||
<p>To help you set up your letter you can download a <a href="https://docs.notifications.service.gov.uk/documentation/images/notify-pdf-letter-word-template-v1.0.docx">Word document template</a>.</p>
|
||||
<p>Your file must meet our <a href="{{ url_for('.upload_a_letter', _anchor='letter-specification') }}">letter specification</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -571,7 +571,7 @@ LETTER_VALIDATION_MESSAGES = {
|
||||
'title': 'Your letter is not A4 portrait size',
|
||||
'detail': (
|
||||
'You need to change the size or orientation of {invalid_pages}. <br>'
|
||||
'Files must meet our <a href="{letter_spec}" target="_blank">letter specification</a>.'
|
||||
'Files must meet our <a href="{letter_spec_guidance}" target="_blank">letter specification</a>.'
|
||||
),
|
||||
'summary': (
|
||||
'Validation failed because {invalid_pages} {invalid_pages_are_or_is} not A4 portrait size.<br>'
|
||||
@@ -582,7 +582,7 @@ LETTER_VALIDATION_MESSAGES = {
|
||||
'title': 'Your content is outside the printable area',
|
||||
'detail': (
|
||||
'You need to edit {invalid_pages}.<br>'
|
||||
'Files must meet our <a href="{letter_spec}" target="_blank">letter specification</a>.'
|
||||
'Files must meet our <a href="{letter_spec_guidance}" target="_blank">letter specification</a>.'
|
||||
),
|
||||
'summary': (
|
||||
'Validation failed because content is outside the printable area on {invalid_pages}.<br>'
|
||||
@@ -618,7 +618,7 @@ LETTER_VALIDATION_MESSAGES = {
|
||||
'title': 'The address block is empty',
|
||||
'detail': (
|
||||
'You need to add a recipient address.<br>'
|
||||
'Files must meet our <a href="{letter_spec}" target="_blank">letter specification</a>.'
|
||||
'Files must meet our <a href="{letter_spec_guidance}" target="_blank">letter specification</a>.'
|
||||
),
|
||||
'summary': (
|
||||
'Validation failed because the address block is empty.<br>'
|
||||
@@ -650,7 +650,7 @@ def get_letter_validation_error(validation_message, invalid_pages=None, page_cou
|
||||
invalid_pages=invalid_pages,
|
||||
invalid_pages_are_or_is=invalid_pages_are_or_is,
|
||||
page_count=page_count,
|
||||
letter_spec=url_for('.letter_spec'),
|
||||
letter_spec_guidance=url_for('.upload_a_letter')
|
||||
),
|
||||
'summary': LETTER_VALIDATION_MESSAGES[validation_message]['summary'].format(
|
||||
invalid_pages=invalid_pages,
|
||||
|
||||
@@ -499,7 +499,7 @@ def test_get_letter_validation_error_for_known_errors(
|
||||
|
||||
assert detail.text == expected_content
|
||||
if detail.select_one('a'):
|
||||
assert detail.select_one('a')['href'] == url_for('.letter_spec')
|
||||
assert detail.select_one('a')['href'] == url_for('.upload_a_letter')
|
||||
assert detail.select_one('a')['target'] == '_blank'
|
||||
|
||||
assert summary.text == expected_summary
|
||||
|
||||
Reference in New Issue
Block a user