Merge pull request #657 from alphagov/make-activity-consistent

Make activity consistent
This commit is contained in:
Chris Hill-Scott
2016-06-08 12:57:07 +01:00
5 changed files with 161 additions and 255 deletions

View File

@@ -18,8 +18,8 @@
statistics.emails_failed,
statistics.get('emails_failure_rate', 0.0),
statistics.get('emails_failure_rate', 0)|float > 3,
failure_link=url_for(".view_notifications", service_id=current_service.id, template_type='email', status='failed'),
label_link=url_for(".view_notifications", service_id=current_service.id, template_type='email', status='delivered,failed')
failure_link=url_for(".view_notifications", service_id=current_service.id, message_type='email', status='failed'),
label_link=url_for(".view_notifications", service_id=current_service.id, message_type='email', status='sending,delivered,failed')
) }}
</div>
<div class="column-half">
@@ -29,8 +29,8 @@
statistics.sms_failed,
statistics.get('sms_failure_rate', 0.0),
statistics.get('sms_failure_rate', 0)|float > 3,
failure_link=url_for(".view_notifications", service_id=current_service.id, template_type='sms', status='failed'),
label_link=url_for(".view_notifications", service_id=current_service.id, template_type='sms', status='delivered,failed')
failure_link=url_for(".view_notifications", service_id=current_service.id, message_type='sms', status='failed'),
label_link=url_for(".view_notifications", service_id=current_service.id, message_type='sms', status='sending,delivered,failed')
) }}
</div>
<div class="column-whole">

View File

@@ -3,65 +3,39 @@
{% from "components/previous-next-navigation.html" import previous_next_navigation %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/pill.html" import pill %}
{% from "components/message-count-label.html" import message_count_label %}
{% block page_title %}
Activity GOV.UK Notify
{{ message_count_label(99, message_type, suffix='') | capitalize }} GOV.UK Notify
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
{%- if (request_args.get('template_type', 'email,sms') == 'email,sms') and (request_args.get('status', 'delivered,failed') == 'delivered,failed') -%}
Activity
{%- else -%}
<span class="visually-hidden">
{%- 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 -%}
</span>
{%- 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' -%}
{{ template_label }}
{%- else -%}
{{ template_label | lower }}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{{- message_count_label(99, message_type, suffix='') | capitalize }}
</h1>
<div class='grid-row bottom-gutter'>
<div class='column-half'>
{{ pill(
'Status',
status_filters,
request_args.get('status', '')
) }}
</div>
<div class='column-half'>
{{ pill(
'Type',
type_filters,
request_args.get('template_type', '')
) }}
</div>
<div class='bottom-gutter'>
{{ pill(
'Status',
status_filters,
request_args.get('status', '')
) }}
</div>
{% if notifications %}
<p class="bottom-gutter">
<a href="{{ request.url }}&amp;download=csv" download class="heading-small">Download as a CSV file</a>
<a href="{{ download_link }}" download="download" class="heading-small">Download as a CSV file</a>
&emsp;
Delivery information is available for 7 days
</p>