From 149456b73ac86859ea925ae155133a9b9697223a Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 12 May 2020 17:30:42 +0100 Subject: [PATCH] Add some more macros for counting things --- .../components/message-count-label.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/templates/components/message-count-label.html b/app/templates/components/message-count-label.html index a4a9078de..b85d8f420 100644 --- a/app/templates/components/message-count-label.html +++ b/app/templates/components/message-count-label.html @@ -61,3 +61,19 @@ {%- endif -%} {%- endif %} {%- endmacro %} + + +{% macro recipient_count(count, template_type, prefix='') -%} + {{ count|format_thousands }} {{ prefix }} {{ recipient_count_label(count, template_type)}} +{% endmacro %} + + +{% macro iteration_count(count) -%} + {% if count == 1 %} + once + {% elif count == 2 %} + twice + {% else %} + {{ count }} times + {% endif %} +{% endmacro %}