From 576cdae5270b12b36b8a522ce37fac26d46dbde9 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Wed, 5 Jan 2022 20:30:42 +0100 Subject: add radio buttons to custom parameters --- client/templatetags/app_filter.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'client/templatetags/app_filter.py') diff --git a/client/templatetags/app_filter.py b/client/templatetags/app_filter.py index 9f378e1..df92775 100644 --- a/client/templatetags/app_filter.py +++ b/client/templatetags/app_filter.py @@ -34,4 +34,16 @@ def doc_count(doc): if doc.max_instances != 0: doc_count += "/" + str(doc.max_instances) - return doc_count \ No newline at end of file + return doc_count + +@register.filter(name="parse_multiple_choice") +def parse_multiple_choice(str): + if len(str) < 3: + return [str, []] + + str = str[3:] + arr = str.split(",") + if len(arr) < 2: + return [arr[0], []] + + return [arr[0], arr[1:]] \ No newline at end of file -- cgit v1.2.1