From c1d08df31d5135fe43c26ea32b5998ad30645162 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Fri, 19 Jul 2024 20:33:19 +0200 Subject: ogcp: improve sidebar logic in Commands Disable all checkboxes of scopes of level higher than room in the $(window).on('pageshow', function) callback. Set checkboxes as "indeterminate" when not every children is selected but have some of its children selected. [x] center [x] room1 [x] client1 [x] client1 [-] center [ ] room1 [-] room2 [ ] client1 [x] client1 Send all selected sidebar fields as form fields. This requires setting disabled to false and replacing indeterminate = true to checked = true in the .on('submit', function) callback. When a checkbox is clicked: 1. Find the room branch of the checked input. [ ] center [ ] room1 [ ] room2 <- root of the room branch [ ] client1 <-- clicked item 2. Uncheck all the checkboxes outside of the room branch. 3. Set all the children of the clicked item to the same value as the clicked item. 4. Set the parent checked or indeterminate values. 5. Save checkbox status. --- ogcp/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ogcp/templates/base.html') diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index df27b9b..da24bfe 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -108,7 +108,7 @@ - +