From e6cbc3482f5122210254e6bb7b19a3650b949a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Thu, 1 Nov 2018 04:41:58 -0400 Subject: [PATCH] Add pretty natural language, oxford commad, 'and's --- agaric/templates/field/field.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agaric/templates/field/field.html.twig b/agaric/templates/field/field.html.twig index fe5fc9b..6b3023b 100644 --- a/agaric/templates/field/field.html.twig +++ b/agaric/templates/field/field.html.twig @@ -58,7 +58,8 @@ {{ label }} {% for item in items %} - {{ item.content }}{% if not loop.last %}, {% endif %} + {% if loop.length > 1 and loop.index == loop.length %}and {% endif %} + {{ item.content }}{% if loop.length > 2 and not loop.last %}, {% endif %} {% endfor %}

{% else %}