From 6d5e2b8d1508bf753f934eb23016aaa0f96414d9 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Tue, 15 Feb 2022 13:23:15 +0100 Subject: [PATCH] #112 TreeWidget JS * adds visual support on (de-)selecting checkboxes * adds same support on initialization of checked checkboxes e.g. on edit forms --- .../widgets/checkbox-tree-select-content.html | 21 +++++++ .../konova/widgets/checkbox-tree-select.html | 63 ++++++++++++------- 2 files changed, 62 insertions(+), 22 deletions(-) create mode 100644 konova/templates/konova/widgets/checkbox-tree-select-content.html diff --git a/konova/templates/konova/widgets/checkbox-tree-select-content.html b/konova/templates/konova/widgets/checkbox-tree-select-content.html new file mode 100644 index 00000000..9bf57253 --- /dev/null +++ b/konova/templates/konova/widgets/checkbox-tree-select-content.html @@ -0,0 +1,21 @@ +{% load l10n fontawesome_5 %} + +{% for code in codes %} +
+ + {% if not code.is_leaf %} +
+ {% with code.children as codes %} + {% include 'konova/widgets/checkbox-tree-select-content.html' %} + {% endwith %} +
+ {% endif %} +
+{% endfor %} \ No newline at end of file diff --git a/konova/templates/konova/widgets/checkbox-tree-select.html b/konova/templates/konova/widgets/checkbox-tree-select.html index 5b40d3f1..ddcc60c0 100644 --- a/konova/templates/konova/widgets/checkbox-tree-select.html +++ b/konova/templates/konova/widgets/checkbox-tree-select.html @@ -1,23 +1,42 @@ -{% load l10n fontawesome_5 %} +
+ {% include 'konova/widgets/checkbox-tree-select-content.html' %} +
-
- {% for code in codes %} -
- - {% if not code.is_leaf %} -
- {% with code.children as codes %} - {% include 'konova/widgets/checkbox-tree-select.html' %} - {% endwith %} -
- {% endif %} -
- {% endfor %} -
\ No newline at end of file + \ No newline at end of file