diff --git a/app/templates/components/message-count-label.html b/app/templates/components/message-count-label.html index 14b997665..0e5cfeedc 100644 --- a/app/templates/components/message-count-label.html +++ b/app/templates/components/message-count-label.html @@ -55,3 +55,26 @@ {%- endif -%} {%- endif %} {%- endmacro %} + + +{% macro folder_contents_count(number_of_folders, number_of_templates) %} + + {% if number_of_folders == number_of_templates == 0 %} + Empty + {% endif %} + + {% if number_of_templates == 1 %} + {{ number_of_templates }} template + {%- elif number_of_templates > 1 -%} + {{ number_of_templates }} templates + {%- endif -%} + + {%- if number_of_folders and number_of_templates %}, {% endif -%} + + {%- if number_of_folders == 1 -%} + {{ number_of_folders }} folder + {%- elif number_of_folders > 1 -%} + {{ number_of_folders }} folders + {% endif %} + +{%- endmacro %} diff --git a/app/templates/views/templates/_template_list.html b/app/templates/views/templates/_template_list.html index 96ecbff53..ca4b7c57a 100644 --- a/app/templates/views/templates/_template_list.html +++ b/app/templates/views/templates/_template_list.html @@ -1,4 +1,5 @@ {% from "components/checkbox.html" import unlabelled_checkbox %} +{% from "components/message-count-label.html" import folder_contents_count %}