mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Fix page titles on activity page
We were getting some weirdness like ‘Failed both’. This commit fixes the problem, and adds some tests for the page headings to make sure they don’t break again.
This commit is contained in:
@@ -116,6 +116,8 @@ def view_notifications(service_id):
|
||||
|
||||
filter_args = _parse_filter_args(request.args)
|
||||
|
||||
print(filter_args)
|
||||
|
||||
notifications = notification_api_client.get_notifications_for_service(
|
||||
service_id=service_id,
|
||||
page=page,
|
||||
@@ -147,8 +149,8 @@ def view_notifications(service_id):
|
||||
service_id=service_id,
|
||||
page=page,
|
||||
page_size=notifications['total'],
|
||||
template_type=filter_args.getlist('template_type') if 'template_type' in filter_args else None,
|
||||
status=filter_args.getlist('status')
|
||||
template_type=filter_args.get('template_type') if 'template_type' in filter_args else ['email', 'sms'],
|
||||
status=filter_args.get('status')
|
||||
if 'status' in filter_args else ['delivered', 'failed'],
|
||||
limit_days=current_app.config['ACTIVITY_STATS_LIMIT_DAYS'])['notifications'])
|
||||
return csv_content, 200, {
|
||||
|
||||
@@ -11,36 +11,32 @@
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">
|
||||
|
||||
{%- if (request_args.get('template_type', '') == '') and (request_args.get('status', 'delivered,failed') == 'delivered,failed') -%}
|
||||
{%- if (request_args.get('template_type', 'email,sms') == 'email,sms') and (request_args.get('status', 'delivered,failed') == 'delivered,failed') -%}
|
||||
|
||||
Activity
|
||||
|
||||
{%- else -%}
|
||||
|
||||
{% if request_args.get('status') != 'delivered,failed' %}
|
||||
{% for label, option, _ in status_filters %}
|
||||
{% if request_args.get('status') == option %}
|
||||
{{ label }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{%- if request_args.get('status') != 'delivered,failed' -%}
|
||||
{%- for label, option, _ in status_filters -%}
|
||||
{%- if request_args.get('status', 'delivered,failed') == option -%}{{label}} {% endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
|
||||
{% if request_args.get('template_type') == '' %}
|
||||
emails and text messages
|
||||
{% else %}
|
||||
{%- if request_args.get('template_type', 'email,sms') == 'email,sms' %} emails and text messages
|
||||
{%- else -%}
|
||||
|
||||
{% for template_label, template_option, _ in type_filters %}
|
||||
{% if request_args.get('template_type') == template_option %}
|
||||
{% if request_args.get('status', 'delivered,failed') == 'delivered,failed' %}
|
||||
{%- for template_label, template_option, _ in type_filters -%}
|
||||
{%- if request_args.get('template_type') == template_option -%}
|
||||
{%- if request_args.get('status', 'delivered,failed') == 'delivered,failed' -%}
|
||||
{{ template_label }}
|
||||
{% else %}
|
||||
{%- else -%}
|
||||
{{ template_label | lower }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
|
||||
{% endif %}
|
||||
{%- endif -%}
|
||||
|
||||
{%- endif -%}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user