2016-04-20 15:37:17 +01:00
|
|
|
{% from "components/big-number.html" import big_number, big_number_with_status %}
|
2016-05-11 15:05:40 +01:00
|
|
|
{% from "components/show-more.html" import show_more %}
|
2016-03-17 11:45:48 +00:00
|
|
|
|
2016-04-27 09:28:42 +01:00
|
|
|
<div
|
|
|
|
|
data-module="update-content"
|
|
|
|
|
data-resource="{{url_for(".service_dashboard_updates", service_id=current_service.id)}}"
|
|
|
|
|
data-key="today"
|
|
|
|
|
data-interval-seconds="2"
|
2016-04-27 09:43:27 +01:00
|
|
|
aria-live="polite"
|
2016-04-27 09:28:42 +01:00
|
|
|
>
|
2016-05-03 13:25:22 +01:00
|
|
|
<div class="grid-row">
|
2016-04-27 09:28:42 +01:00
|
|
|
<div class="column-half">
|
|
|
|
|
{{ big_number_with_status(
|
2016-04-28 08:38:13 +01:00
|
|
|
statistics.emails_requested,
|
2016-05-11 15:05:40 +01:00
|
|
|
'email sent' if statistics.emails_requested == 1 else 'emails sent',
|
2016-04-27 12:25:08 +01:00
|
|
|
statistics.emails_failed,
|
2016-04-27 09:28:42 +01:00
|
|
|
statistics.get('emails_failure_rate', 0.0),
|
|
|
|
|
statistics.get('emails_failure_rate', 0)|float > 3,
|
2016-04-29 15:47:31 +01:00
|
|
|
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')
|
2016-04-27 09:28:42 +01:00
|
|
|
) }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="column-half">
|
|
|
|
|
{{ big_number_with_status(
|
2016-04-28 08:38:13 +01:00
|
|
|
statistics.sms_requested,
|
2016-05-11 15:05:40 +01:00
|
|
|
'text message sent' if statistics.sms_requested == 1 else 'text messages sent',
|
2016-04-27 12:25:08 +01:00
|
|
|
statistics.sms_failed,
|
2016-04-27 09:28:42 +01:00
|
|
|
statistics.get('sms_failure_rate', 0.0),
|
|
|
|
|
statistics.get('sms_failure_rate', 0)|float > 3,
|
2016-04-29 15:47:31 +01:00
|
|
|
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')
|
2016-04-27 09:28:42 +01:00
|
|
|
) }}
|
|
|
|
|
</div>
|
2016-05-03 13:25:22 +01:00
|
|
|
<div class="column-whole">
|
2016-05-11 15:05:40 +01:00
|
|
|
{{ show_more(
|
|
|
|
|
url_for('.weekly', service_id=current_service.id),
|
|
|
|
|
'Compare to previous weeks'
|
|
|
|
|
) }}
|
2016-05-03 13:25:22 +01:00
|
|
|
</div>
|
2016-03-17 11:45:48 +00:00
|
|
|
</div>
|
2016-05-11 15:05:40 +01:00
|
|
|
|
|
|
|
|
{% if template_statistics|length > 1 %}
|
2016-04-27 09:28:42 +01:00
|
|
|
{% include 'views/dashboard/template-statistics.html' %}
|
2016-05-11 15:05:40 +01:00
|
|
|
{{ show_more(
|
|
|
|
|
url_for('.template_history', service_id=current_service.id),
|
|
|
|
|
'See all templates sent this year'
|
|
|
|
|
) }}
|
|
|
|
|
{% endif %}
|
2016-04-20 15:37:17 +01:00
|
|
|
|
|
|
|
|
{% if current_user.has_permissions(['manage_settings'], admin_override=True) %}
|
2016-05-11 15:05:40 +01:00
|
|
|
<h2 class='heading-medium'>This year</h2>
|
2016-04-20 15:37:17 +01:00
|
|
|
|
|
|
|
|
<div class='grid-row'>
|
|
|
|
|
<div class='column-half'>
|
|
|
|
|
<div class="keyline-block">
|
2016-05-05 10:34:15 +01:00
|
|
|
{{ big_number("Unlimited", 'free email allowance', smaller=True) }}
|
2016-04-20 15:37:17 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class='column-half'>
|
|
|
|
|
<div class="keyline-block">
|
|
|
|
|
{% if sms_chargeable %}
|
|
|
|
|
{{ big_number(
|
|
|
|
|
(sms_chargeable * sms_rate),
|
|
|
|
|
'spent on text messages',
|
|
|
|
|
currency="£",
|
2016-05-05 10:34:15 +01:00
|
|
|
smaller=True
|
2016-04-20 15:37:17 +01:00
|
|
|
) }}
|
|
|
|
|
{% else %}
|
2016-05-05 10:34:15 +01:00
|
|
|
{{ big_number(sms_allowance_remaining, 'free text messages left', smaller=True) }}
|
2016-04-20 15:37:17 +01:00
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2016-05-11 15:05:40 +01:00
|
|
|
{{ show_more(
|
|
|
|
|
url_for(".usage", service_id=current_service['id']),
|
|
|
|
|
'See usage breakdown'
|
|
|
|
|
) }}
|
2016-04-20 15:37:17 +01:00
|
|
|
{% endif %}
|
|
|
|
|
|
2016-03-17 11:45:48 +00:00
|
|
|
</div>
|