mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Link back to uploaded letters page
If you’ve come to look at a notification via the uploaded letters page then the ‘< back’ link should take you back there, not to the usual activity page.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from functools import partial
|
||||
|
||||
from flask import (
|
||||
Response,
|
||||
abort,
|
||||
@@ -289,6 +291,11 @@ def get_notifications(service_id, message_type, status_override=None):
|
||||
status=request.args.get('status'),
|
||||
message_type=message_type,
|
||||
download_link=download_link,
|
||||
single_notification_url=partial(
|
||||
url_for,
|
||||
'.view_notification',
|
||||
service_id=current_service.id,
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,12 @@ def view_notification(service_id, notification_id):
|
||||
service_id=current_service.id,
|
||||
job_id=request.args.get('from_job'),
|
||||
)
|
||||
elif request.args.get('from_uploaded_letters'):
|
||||
back_link = url_for(
|
||||
'main.uploaded_letters',
|
||||
service_id=current_service.id,
|
||||
letter_print_day=request.args.get('from_uploaded_letters'),
|
||||
)
|
||||
else:
|
||||
back_link = url_for(
|
||||
'main.view_notifications',
|
||||
|
||||
@@ -4,6 +4,7 @@ import json
|
||||
import urllib
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from functools import partial
|
||||
from io import BytesIO
|
||||
from zipfile import BadZipFile
|
||||
|
||||
@@ -126,6 +127,12 @@ def uploaded_letters(service_id, letter_print_day):
|
||||
letter_print_day,
|
||||
),
|
||||
letter_print_day=letter_print_day,
|
||||
single_notification_url=partial(
|
||||
url_for,
|
||||
'.view_notification',
|
||||
service_id=current_service.id,
|
||||
from_uploaded_letters=letter_print_day,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{% if item.status in ('pending-virus-check', 'virus-scan-failed') %}
|
||||
<span class="file-list-filename loading-indicator">Checking</span>
|
||||
{% else %}
|
||||
<a class="govuk-link govuk-link--no-visited-state file-list-filename" href="{{ url_for('.view_notification', service_id=current_service.id, notification_id=item.id) }}">{{ item.to.splitlines()[0].lstrip().rstrip(' ,') if item.to else '' }}</a>
|
||||
<a class="govuk-link govuk-link--no-visited-state file-list-filename" href="{{ single_notification_url(notification_id=item.id) }}">{{ item.to.splitlines()[0].lstrip().rstrip(' ,') if item.to else '' }}</a>
|
||||
{% endif %}
|
||||
<p class="file-list-hint">
|
||||
{{ item.preview_of_content }}
|
||||
|
||||
Reference in New Issue
Block a user