diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index eb99a830a..f2e807e98 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -52,9 +52,9 @@ def showjobs(service_id): ) -@main.route("//jobs/job") +@main.route("//jobs/") @login_required -def showjob(service_id): +def showjob(service_id, job_id): return render_template( 'views/job.html', messages=messages, @@ -76,9 +76,9 @@ def showjob(service_id): ) -@main.route("//jobs/job/notification/") +@main.route("//jobs//notification/") @login_required -def shownotification(service_id, notification_id): +def shownotification(service_id, job_id, notification_id): return render_template( 'views/notification.html', message=[ @@ -86,5 +86,6 @@ def shownotification(service_id, notification_id): ][0], delivered_at=now, uploaded_at=now, - service_id=service_id + service_id=service_id, + job_id=job_id ) diff --git a/app/main/views/sms.py b/app/main/views/sms.py index 939fdb7c4..48d730684 100644 --- a/app/main/views/sms.py +++ b/app/main/views/sms.py @@ -83,7 +83,7 @@ def checksms(service_id): service_id=service_id ) elif request.method == 'POST': - return redirect(url_for('.showjob', service_id=service_id)) + return redirect(url_for('.showjob', service_id=service_id, job_id=456)) def _build_upload_result(csv_file): diff --git a/app/templates/views/dashboard.html b/app/templates/views/dashboard.html index 1f763b865..bf9e9c688 100644 --- a/app/templates/views/dashboard.html +++ b/app/templates/views/dashboard.html @@ -30,10 +30,10 @@ field_headings=['Job', 'File', 'Time', 'Status'] ) %} {% call field() %} - {{ item.file }} + {{ item.file }} {% endcall %} {% call field() %} - {{ item.job }} + {{ item.job }} {% endcall %} {% call field() %} {{ item.time }} diff --git a/app/templates/views/job.html b/app/templates/views/job.html index e7b7ff8ce..fa37dfdc4 100644 --- a/app/templates/views/job.html +++ b/app/templates/views/job.html @@ -52,10 +52,10 @@ GOV.UK Notify | Notifications activity ] ) %} {% call field() %} - {{item.phone}} + {{item.phone}} {% endcall %} {% call field() %} - {{item.message[:50]}}… + {{item.message[:50]}}… {% endcall %} {% call field( align='right', diff --git a/app/templates/views/jobs.html b/app/templates/views/jobs.html index 0c9d0fab2..1f66ec613 100644 --- a/app/templates/views/jobs.html +++ b/app/templates/views/jobs.html @@ -16,10 +16,10 @@ GOV.UK Notify | Notifications activity field_headings=['Job', 'File', 'Time', 'Status'] ) %} {% call field() %} - {{ item.file }} + {{ item.file }} {% endcall %} {% call field() %} - {{ item.job }} + {{ item.job }} {% endcall %} {% call field() %} {{ item.time }} diff --git a/app/templates/views/notification.html b/app/templates/views/notification.html index a598a85d6..d633dd3ff 100644 --- a/app/templates/views/notification.html +++ b/app/templates/views/notification.html @@ -26,7 +26,7 @@ GOV.UK Notify | Notifications activity {{ page_footer( - back_link = url_for('.showjob', service_id=service_id), + back_link = url_for('.showjob', service_id=service_id, job_id=job_id), back_link_text = 'View other messages in this job' ) }} diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index 7c4b9cbca..259ae8649 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -18,7 +18,7 @@ def test_should_show_page_for_one_job(notifications_admin, notifications_admin_d with notifications_admin.test_client() as client: user = create_test_user('active') client.login(user) - response = client.get('/123/jobs/job') + response = client.get('/123/jobs/456') assert response.status_code == 200 assert 'dispatch_20151114.csv' in response.get_data(as_text=True) @@ -30,7 +30,7 @@ def test_should_show_page_for_one_notification(notifications_admin, notification with notifications_admin.test_client() as client: user = create_test_user('active') client.login(user) - response = client.get('/123/jobs/job/notification/3') + response = client.get('/123/jobs/456/notification/3') assert response.status_code == 200 assert 'Text message' in response.get_data(as_text=True) diff --git a/tests/app/main/views/test_sms.py b/tests/app/main/views/test_sms.py index e25033f41..b14a15187 100644 --- a/tests/app/main/views/test_sms.py +++ b/tests/app/main/views/test_sms.py @@ -105,4 +105,4 @@ def test_should_redirect_to_job(notifications_admin, notifications_admin_db, response = client.post('/123/sms/check') assert response.status_code == 302 - assert response.location == 'http://localhost/123/jobs/job' + assert response.location == 'http://localhost/123/jobs/456'