mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 00:33:58 -04:00
Refactor summaries into model
This lets us encapsulate some of the logic that’s currently cluttering up the view/template layer.
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
{% 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) }}">
|
||||
{% if current_service.inbound_sms_summary != None %}
|
||||
<a id="total-received" class="govuk-link govuk-link--no-visited-state banner-dashboard" class="banner-dashboard" href="{{ url_for('.inbox', service_id=current_service.id) }}">
|
||||
<span class="banner-dashboard-count">
|
||||
{{ inbound_sms_summary.count|format_thousands }}
|
||||
{{ current_service.inbound_sms_summary.count|format_thousands }}
|
||||
</span>
|
||||
<span class="banner-dashboard-count-label">
|
||||
{{ message_count_label(inbound_sms_summary.count, 'sms', suffix='received') }}
|
||||
{{ message_count_label(current_service.inbound_sms_summary.count, 'sms', suffix='received') }}
|
||||
</span>
|
||||
{% if inbound_sms_summary.most_recent %}
|
||||
{% if current_service.inbound_sms_summary.most_recent %}
|
||||
<span class="banner-dashboard-meta">
|
||||
latest message {{ inbound_sms_summary.most_recent | format_delta }}
|
||||
latest message {{ current_service.inbound_sms_summary.most_recent | format_delta }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user