mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Revert "Restyle template statistics and received text messages"
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{% macro show_more(url, label, with_border=True) %}
|
||||
<a
|
||||
href="{{ url }}"
|
||||
class="show-more{% if not with_border %}-no-border{% endif %}"
|
||||
><span>{{ label }}</span></a>
|
||||
{% macro show_more(url=None, label=None) %}
|
||||
{% if url and label %}
|
||||
<a href="{{ url }}" class="show-more"><span>{{ label }}</span></a>
|
||||
{% else %}
|
||||
<span class="show-more-empty"></span>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -188,8 +188,11 @@
|
||||
) %}
|
||||
{% call field(align='right') %}
|
||||
<span {% if id %}id="{{ id }}"{% endif %} class="spark-bar">
|
||||
<span class="spark-bar-bar" style="width: {{ count / max_count * 100 }}%">
|
||||
{{ '{:,.0f}'.format(count) }}
|
||||
<span style="width: {{ count / max_count * 100 }}%">
|
||||
{{ big_number(
|
||||
count,
|
||||
smallest=True
|
||||
) }}
|
||||
</span>
|
||||
</span>
|
||||
{% endcall %}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
{% from "components/big-number.html" import big_number, big_number_with_status %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
<div class="ajax-block">
|
||||
{% if inbound_sms_summary != None %}
|
||||
<a id="total-received" class="govuk-link govuk-link--no-visited-state banner-dashboard" href="{{ url_for('.inbox', service_id=current_service.id) }}">
|
||||
<span class="banner-dashboard-count">
|
||||
{{ inbound_sms_summary.count|format_thousands }}
|
||||
</span>
|
||||
<span class="banner-dashboard-count-label">
|
||||
{{ message_count_label(inbound_sms_summary.count, 'sms', suffix='received') }}
|
||||
</span>
|
||||
{% if inbound_sms_summary.most_recent %}
|
||||
<span class="banner-dashboard-meta">
|
||||
<div id="total-received" class="big-number-meta-wrapper">
|
||||
{{
|
||||
big_number_with_status(
|
||||
inbound_sms_summary.count,
|
||||
'text messages received',
|
||||
link=url_for('.inbox', service_id=current_service.id),
|
||||
show_failures=False
|
||||
)
|
||||
}}
|
||||
<div class="big-number-meta">
|
||||
{% if inbound_sms_summary.most_recent %}
|
||||
latest message {{ inbound_sms_summary.most_recent | format_delta }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<div class="ajax-block-container">
|
||||
<div class="grid-row">
|
||||
<div id="total-email" class="column-third">
|
||||
<div id="total-email" class="{{column_width}}">
|
||||
{{ big_number_with_status(
|
||||
statistics['email']['requested'],
|
||||
message_count_label(statistics['email']['requested'], 'email', suffix='sent'),
|
||||
@@ -12,10 +12,10 @@
|
||||
statistics['email']['show_warning'],
|
||||
failure_link=url_for(".view_notifications", service_id=service_id, message_type='email', status='failed'),
|
||||
link=url_for(".view_notifications", service_id=service_id, message_type='email', status='sending,delivered,failed'),
|
||||
smaller=True,
|
||||
smaller=smaller_font_size
|
||||
) }}
|
||||
</div>
|
||||
<div id="total-sms" class="column-third">
|
||||
<div id="total-sms" class="{{column_width}}">
|
||||
{{ big_number_with_status(
|
||||
statistics['sms']['requested'],
|
||||
message_count_label(statistics['sms']['requested'], 'sms', suffix='sent'),
|
||||
@@ -24,10 +24,10 @@
|
||||
statistics['sms']['show_warning'],
|
||||
failure_link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='failed'),
|
||||
link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='sending,delivered,failed'),
|
||||
smaller=True,
|
||||
smaller=smaller_font_size
|
||||
) }}
|
||||
</div>
|
||||
<div id="total-letters" class="column-third">
|
||||
<div id="total-letters" class="{{column_width}}">
|
||||
{{ big_number_with_status(
|
||||
statistics['letter']['requested'],
|
||||
message_count_label(statistics['letter']['requested'], 'letter', suffix='sent'),
|
||||
@@ -36,7 +36,7 @@
|
||||
statistics['letter']['show_warning'],
|
||||
failure_link=url_for(".view_notifications", service_id=service_id, message_type='letter', status='failed'),
|
||||
link=url_for(".view_notifications", service_id=service_id, message_type='letter', status=''),
|
||||
smaller=True,
|
||||
smaller=smaller_font_size
|
||||
) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
) }}
|
||||
{% endcall %}
|
||||
{% endcall %}
|
||||
{{ show_more() }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{% from "components/big-number.html" import big_number %}
|
||||
|
||||
<div class='grid-row ajax-block-container'>
|
||||
<div class='column-third'>
|
||||
<div class='{{ column_width }}'>
|
||||
<div class="keyline-block">
|
||||
{{ big_number("Unlimited", 'free email allowance', smaller=True) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class='column-third'>
|
||||
<div class='{{ column_width }}'>
|
||||
<div class="keyline-block">
|
||||
{% if sms_chargeable %}
|
||||
{{ big_number(
|
||||
@@ -20,7 +20,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class='column-third'>
|
||||
<div class='{{ column_width }}'>
|
||||
<div class="keyline-block">
|
||||
{{ big_number(
|
||||
letter_cost,
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
No messages sent
|
||||
</p>
|
||||
{% else %}
|
||||
<div class='template-statistics-table'>
|
||||
<div class='dashboard-table template-usage-table'>
|
||||
{% call(item, row_number) list_table(
|
||||
month.templates_used,
|
||||
caption=month.name,
|
||||
@@ -41,8 +41,8 @@
|
||||
field_headings_visible=False
|
||||
) %}
|
||||
{% call row_heading() %}
|
||||
<a class="template-statistics-table-template-name" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}">{{ item.name }}</a>
|
||||
<span class="template-statistics-table-hint">
|
||||
<a class="file-list-filename" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}">{{ item.name }}</a>
|
||||
<span class="file-list-hint">
|
||||
{{ message_count_label(1, item.type, suffix='template')|capitalize }}
|
||||
</span>
|
||||
{% endcall %}
|
||||
|
||||
@@ -6,41 +6,39 @@
|
||||
|
||||
<div class="ajax-block-container">
|
||||
{% if template_statistics|length > 1 %}
|
||||
<div class='template-statistics-table'>
|
||||
<div class='dashboard-table'>
|
||||
{% call(item, row_number) list_table(
|
||||
template_statistics,
|
||||
caption="By template",
|
||||
caption_visible=True,
|
||||
caption="Templates used",
|
||||
caption_visible=False,
|
||||
empty_message='',
|
||||
field_headings=[
|
||||
'Template',
|
||||
'Messages sent'
|
||||
],
|
||||
field_headings_visible=False
|
||||
field_headings_visible=True
|
||||
) %}
|
||||
|
||||
{% call row_heading() %}
|
||||
{% if item.is_precompiled_letter %}
|
||||
<span class="template-statistics-table-template-name">
|
||||
<span class="file-list-filename">
|
||||
Provided as PDF
|
||||
</span>
|
||||
<span class="template-statistics-table-hint">
|
||||
<span class="file-list-hint">
|
||||
Letter
|
||||
</span>
|
||||
{% else %}
|
||||
<a class="template-statistics-table-template-name" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.template_id) }}">{{ item.template_name }}</a>
|
||||
<span class="template-statistics-table-hint">
|
||||
<a class="file-list-filename" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.template_id) }}">{{ item.template_name }}</a>
|
||||
<span class="file-list-hint">
|
||||
{{ message_count_label(1, item.template_type, suffix='template')|capitalize }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
{{ spark_bar_field(item.count, most_used_template_count, id=item.template_id) }}
|
||||
{% endcall %}
|
||||
{{ show_more(
|
||||
url_for('.template_usage', service_id=current_service.id),
|
||||
'See templates used by month',
|
||||
with_border=False
|
||||
'See templates used by month'
|
||||
) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user