Make custom data retention look a bit nicer

This should make it easier to see what’s set without having to click
into the table.
This commit is contained in:
Chris Hill-Scott
2020-10-19 16:47:55 +01:00
parent e5de00e0ce
commit 9b7357025c
3 changed files with 15 additions and 5 deletions

View File

@@ -370,9 +370,19 @@
{{ edit_field('Change', url_for('.service_set_letter_branding', service_id=current_service.id), suffix='letter branding (admin view)') }}
{% endcall %}
{% call row() %}
{{ text_field('Data retention')}}
{{ text_field('Custom data retention')}}
{% call field() %}
{{ current_service.data_retention | join(', ', attribute='notification_type') }}
{% for channel in current_service.data_retention %}
{% if loop.first %}
<ul>
{% endif %}
<li>{{ channel.notification_type|format_notification_type }} {{ channel.days_of_retention }} days</li>
{% if loop.last %}
</ul>
{% endif %}
{% else %}
<div class="table-field-status-default">Not set</div>
{% endfor %}
{% endcall %}
{{ edit_field('Change', url_for('.data_retention', service_id=current_service.id), suffix='data retention') }}
{% endcall %}

View File

@@ -45,7 +45,7 @@
{% for item in current_service.data_retention %}
{% call row() %}
{{ text_field(item.notification_type | format_notification_type)}}
{{ text_field(item.days_of_retention) }}
{{ text_field(item.days_of_retention|string + ' days') }}
{{ edit_field('Change', url_for('.edit_data_retention', service_id=current_service.id, data_retention_id=item.id)) }}
{% endcall %}