mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 00:33:58 -04:00
Update utils with to make letters unclickable
Brings in: - [ ] https://github.com/alphagov/notifications-utils/pull/159 Means: - renaming a bunch of things - removing any CSS that targeted the link, and making it target the containing element too
This commit is contained in:
@@ -8,7 +8,7 @@ $iso-paper-ratio: 141.42135624%;
|
|||||||
|
|
||||||
.letter {
|
.letter {
|
||||||
|
|
||||||
padding: 0;
|
padding: $iso-paper-ratio 0 0 0;
|
||||||
margin: 0 0 $gutter 0;
|
margin: 0 0 $gutter 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: $panel-colour;
|
background: $panel-colour;
|
||||||
@@ -28,16 +28,6 @@ $iso-paper-ratio: 141.42135624%;
|
|||||||
width: 0px;
|
width: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 100%;
|
|
||||||
height: 0;
|
|
||||||
padding: $iso-paper-ratio 0 0 0;
|
|
||||||
position: relative;
|
|
||||||
z-index: 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -87,7 +87,12 @@ def send_messages(service_id, template_id):
|
|||||||
service_api_client.get_service_template(service_id, template_id)['data'],
|
service_api_client.get_service_template(service_id, template_id)['data'],
|
||||||
current_service,
|
current_service,
|
||||||
show_recipient=True,
|
show_recipient=True,
|
||||||
letter_preview_url=url_for('.view_template', service_id=service_id, template_id=template_id),
|
letter_preview_url=url_for(
|
||||||
|
'.view_letter_template_preview',
|
||||||
|
service_id=service_id,
|
||||||
|
template_id=template_id,
|
||||||
|
filetype='png',
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
form = CsvUploadForm()
|
form = CsvUploadForm()
|
||||||
@@ -149,7 +154,12 @@ def send_test(service_id, template_id):
|
|||||||
service_api_client.get_service_template(service_id, template_id)['data'],
|
service_api_client.get_service_template(service_id, template_id)['data'],
|
||||||
current_service,
|
current_service,
|
||||||
show_recipient=True,
|
show_recipient=True,
|
||||||
letter_preview_url=url_for('.view_template', service_id=service_id, template_id=template_id),
|
letter_preview_url=url_for(
|
||||||
|
'.view_letter_template_preview',
|
||||||
|
service_id=service_id,
|
||||||
|
template_id=template_id,
|
||||||
|
filetype='png',
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(template.placeholders) == 0 or request.method == 'POST':
|
if len(template.placeholders) == 0 or request.method == 'POST':
|
||||||
@@ -212,10 +222,11 @@ def _check_messages(service_id, template_type, upload_id, letters_as_pdf=False):
|
|||||||
current_service,
|
current_service,
|
||||||
show_recipient=True,
|
show_recipient=True,
|
||||||
letter_preview_url=url_for(
|
letter_preview_url=url_for(
|
||||||
'.check_messages',
|
'.check_messages_preview',
|
||||||
service_id=service_id,
|
service_id=service_id,
|
||||||
template_type=template_type,
|
template_type=template_type,
|
||||||
upload_id=upload_id
|
upload_id=upload_id,
|
||||||
|
filetype='png',
|
||||||
) if not letters_as_pdf else None
|
) if not letters_as_pdf else None
|
||||||
)
|
)
|
||||||
recipients = RecipientCSV(
|
recipients = RecipientCSV(
|
||||||
|
|||||||
@@ -84,7 +84,12 @@ def view_template(service_id, template_id):
|
|||||||
template,
|
template,
|
||||||
current_service,
|
current_service,
|
||||||
expand_emails=True,
|
expand_emails=True,
|
||||||
letter_preview_url=url_for('.view_template', service_id=service_id, template_id=template_id),
|
letter_preview_url=url_for(
|
||||||
|
'.view_letter_template_preview',
|
||||||
|
service_id=service_id,
|
||||||
|
template_id=template_id,
|
||||||
|
filetype='png',
|
||||||
|
),
|
||||||
show_recipient=True,
|
show_recipient=True,
|
||||||
page_count=page_count,
|
page_count=page_count,
|
||||||
),
|
),
|
||||||
@@ -108,10 +113,11 @@ def _view_template_version(service_id, template_id, version, letters_as_pdf=Fals
|
|||||||
current_service,
|
current_service,
|
||||||
expand_emails=True,
|
expand_emails=True,
|
||||||
letter_preview_url=url_for(
|
letter_preview_url=url_for(
|
||||||
'.view_template_version',
|
'.view_template_version_preview',
|
||||||
service_id=service_id,
|
service_id=service_id,
|
||||||
template_id=template_id,
|
template_id=template_id,
|
||||||
version=version,
|
version=version,
|
||||||
|
filetype='png',
|
||||||
) if not letters_as_pdf else None
|
) if not letters_as_pdf else None
|
||||||
))
|
))
|
||||||
|
|
||||||
@@ -344,7 +350,12 @@ def delete_service_template(service_id, template_id):
|
|||||||
template,
|
template,
|
||||||
current_service,
|
current_service,
|
||||||
expand_emails=True,
|
expand_emails=True,
|
||||||
letter_preview_url=url_for('.view_template', service_id=service_id, template_id=template['id']),
|
letter_preview_url=url_for(
|
||||||
|
'.view_letter_template_preview',
|
||||||
|
service_id=service_id,
|
||||||
|
template_id=template['id'],
|
||||||
|
filetype='png',
|
||||||
|
),
|
||||||
show_recipient=True,
|
show_recipient=True,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -370,10 +381,11 @@ def view_template_versions(service_id, template_id):
|
|||||||
current_service,
|
current_service,
|
||||||
expand_emails=True,
|
expand_emails=True,
|
||||||
letter_preview_url=url_for(
|
letter_preview_url=url_for(
|
||||||
'.view_template_version',
|
'.view_template_version_preview',
|
||||||
service_id=service_id,
|
service_id=service_id,
|
||||||
template_id=template_id,
|
template_id=template_id,
|
||||||
version=template['version'],
|
version=template['version'],
|
||||||
|
filetype='png',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
for template in service_api_client.get_service_template_versions(service_id, template_id)['data']
|
for template in service_api_client.get_service_template_versions(service_id, template_id)['data']
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from flask_login import current_user
|
|||||||
from notifications_utils.template import (
|
from notifications_utils.template import (
|
||||||
SMSPreviewTemplate,
|
SMSPreviewTemplate,
|
||||||
EmailPreviewTemplate,
|
EmailPreviewTemplate,
|
||||||
LetterPDFLinkTemplate,
|
LetterImageTemplate,
|
||||||
LetterPreviewTemplate,
|
LetterPreviewTemplate,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -274,9 +274,9 @@ def get_template(
|
|||||||
)
|
)
|
||||||
if 'letter' == template['template_type']:
|
if 'letter' == template['template_type']:
|
||||||
if letter_preview_url:
|
if letter_preview_url:
|
||||||
return LetterPDFLinkTemplate(
|
return LetterImageTemplate(
|
||||||
template,
|
template,
|
||||||
preview_url=letter_preview_url,
|
image_url=letter_preview_url,
|
||||||
page_count=int(page_count),
|
page_count=int(page_count),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -28,4 +28,4 @@ notifications-python-client>=3.1,<3.2
|
|||||||
awscli>=1.11,<1.12
|
awscli>=1.11,<1.12
|
||||||
awscli-cwlogs>=1.4,<1.5
|
awscli-cwlogs>=1.4,<1.5
|
||||||
|
|
||||||
git+https://github.com/alphagov/notifications-utils.git@16.2.0#egg=notifications-utils==16.2.0
|
git+https://github.com/alphagov/notifications-utils.git@17.0.1#egg=notifications-utils==17.0.1
|
||||||
|
|||||||
Reference in New Issue
Block a user