Show usage count on uploads page

Because we’re be grouping jobs under their parent contact lists it’s
good to have some information ‘scent’ to help people find their jobs,
ie by clicking into a contact list. It also lets you see which list have
been used more than others, maybe because the update hasn’t been sent
to that group of people yet.

The hint text under uploads always says when they were used. For contact
lists this is a bit more complicated, since they can:
- never have been used
- been used multiple times

This commit makes use of the new fields being returned by the API to say
determine when these messages are relevant. They also let us
differentiate between a contact list that’s never been used, and one
that has been used, but not recently enough to show any jobs against it.
This commit is contained in:
Chris Hill-Scott
2020-05-12 17:52:13 +01:00
parent 423875011c
commit 45b60e9555
6 changed files with 49 additions and 16 deletions

View File

@@ -24,6 +24,8 @@ class ContactList(JSONModel):
ALLOWED_PROPERTIES = {
'id',
'created_by',
'has_jobs',
'recent_job_count',
'service_id',
'original_file_name',
'row_count',

View File

@@ -1,6 +1,6 @@
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading %}
{% from "components/big-number.html" import big_number -%}
{% from "components/message-count-label.html" import message_count_label, recipient_count_label -%}
{% from "components/message-count-label.html" import message_count_label, recipient_count_label, iteration_count -%}
<div class='dashboard-table ajax-block-container'>
{% call(item, row_number) list_table(
@@ -35,10 +35,18 @@
</span>
{% elif item.upload_type == 'contact_list' %}
<span class="file-list-hint-large">
Uploaded {{
item.created_at|format_datetime_relative
}}
</span>
{% if item.recent_job_count %}
Used {{ iteration_count(item.recent_job_count) }}
in the last
{{ current_service.get_days_of_retention(item.template_type) }}
days
{% elif item.has_jobs %}
Not used in the last
{{ current_service.get_days_of_retention(item.template_type) }}
days
{% else %}
Not used yet
{% endif %}
{% elif item.upload_type == 'letter_day' %}
<span class="file-list-hint-large">
{{ item.letter_printing_statement }}