mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Adding views to view, add and edit service data retention policies.
Only visible to a platform admin. A service can have a custom number of days to retain the notification data for each notification type.
This commit is contained in:
@@ -322,8 +322,10 @@
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Data Retention')}}
|
||||
{{ text_field(data_retention[0]['notification_type']) }}
|
||||
{{ edit_field('Change', url_for('.set_data_retention', service_id=current_service.id)) }}
|
||||
{% call field() %}
|
||||
{{ data_retention | join(', ', attribute='notification_type') }}
|
||||
{% endcall %}
|
||||
{{ edit_field('Change', url_for('.data_retention', service_id=current_service.id)) }}
|
||||
{% endcall %}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
44
app/templates/views/service-settings/data-retention.html
Normal file
44
app/templates/views/service-settings/data-retention.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/api-key.html" import api_key %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/table.html" import row_group, row, text_field, edit_field, field, boolean_field, list_table with context %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Email reply to addresses
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row bottom-gutter">
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">
|
||||
Data retention
|
||||
</h1>
|
||||
</div>
|
||||
<div class="column-one-third">
|
||||
<a href="{{ url_for('.add_data_retention', service_id=current_service.id) }}" class="button align-with-heading">Add data retention</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-row bottom-gutter">
|
||||
<div class="column-full">
|
||||
By default data is kept for 7 days
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-list">
|
||||
{% if not data_retention_settings %}
|
||||
<div class="user-list-item">
|
||||
<span class="hint">You haven’t added any data retention</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% for item in data_retention_settings %}
|
||||
<div class="user-list-item">
|
||||
|
||||
<p>
|
||||
{{ item.notification_type | format_notification_type }} notifications will be kept for {{ item.days_of_retention }} days
|
||||
<a class="user-list-edit-link" href="{{ url_for('.edit_data_retention', service_id =current_service.id, data_retention_id = item.id) }}">Change</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
25
app/templates/views/service-settings/data-retention/add.html
Normal file
25
app/templates/views/service-settings/data-retention/add.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% from "components/radios.html" import radios %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Data retention
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
|
||||
<h1 class="heading-large">Set data retention</h1>
|
||||
<form method="post">
|
||||
{{ radios(form.notification_type) }}
|
||||
{{ textbox(form.days_of_retention) }}
|
||||
{{ page_footer(
|
||||
'Add',
|
||||
back_link=url_for('.add_data_retention', service_id=current_service.id),
|
||||
back_link_text='Back'
|
||||
) }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% from "components/radios.html" import radios %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Data retention
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
|
||||
<h1 class="heading-large">Set data retention</h1>
|
||||
<form method="post">
|
||||
{{ notification_type | capitalize}}
|
||||
{{ textbox(form.days_of_retention) }}
|
||||
{{ page_footer(
|
||||
'Save',
|
||||
back_link=url_for('.edit_data_retention', service_id=current_service.id, data_retention_id=data_retention_id),
|
||||
back_link_text='Back'
|
||||
) }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,28 +0,0 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Data retention
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
<h1 class="heading-large">Emails</h1>
|
||||
<p>
|
||||
Add new data retention here
|
||||
</p>
|
||||
{% for item in data_retentions %}
|
||||
{{ item.notification_type }}
|
||||
{{ item.days_of_retention }}
|
||||
{% endfor %}
|
||||
{{ page_footer(
|
||||
back_link=url_for('.service_settings', service_id=current_service.id),
|
||||
back_link_text='Back to settings'
|
||||
) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user