If possible, show sent not uploaded time for jobs

If you’re looking back at a job that was scheduled and has now been sent
it’s more useful and consistent to know what time it went out. The time
it was uploaded at is a bit arbitrary once it’s sent.

The only time the uploaded time is relevant is when the job is still
waiting to be sent.

Slightly fiddlier than it sounds because we never want to show
‘uploaded by’ for a job that hasn’t been scheduled because it almost
immediately changes to ‘sent by’. This flickering of the UI is
undesirable.
This commit is contained in:
Chris Hill-Scott
2016-10-12 09:23:59 +01:00
parent 4b0d8ec636
commit 3761a7a436
2 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,13 @@
<div class="ajax-block-container">
<p class='heading-small bottom-gutter'>
Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
{% if job.scheduled_for %}
{% if job.processing_started %}
Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short }}
{% else %}
Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
{% endif %}
{% else %}
Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
{% endif %}
</p>
</div>

View File

@@ -267,7 +267,7 @@ def test_should_show_updates_for_one_job_as_json(
assert 'Status' in content['notifications']
assert 'Delivered' in content['notifications']
assert '12:01am' in content['notifications']
assert 'Uploaded by Test User on 1 January at midnight' in content['status']
assert 'Sent by Test User on 1 January at midnight' in content['status']
@pytest.mark.parametrize(