summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-11 14:16:16 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-14 09:24:39 +0200
commit272a5067ad6bc4a9b5e4a401ea7625e71d6914af (patch)
tree131febef6daf2945a0c6f5e0f72cdceb03d25bb1 /ogcp/templates
parent0153b2b13fd0e28753646fe0ca961e8cae931d26 (diff)
src: revisit sidebar context storage approach
Maintain selections made in scope sidebar after clicking an action (ie. client add, room delete, etc.) Use ids instead of names as the name html property is the same for every room and center. Call keepSelectedClients() in macros.html for both Scope Management and Commands instead of only in Commands. Add a "context" value to the checkbox id to separate scope and commands values in local storage.
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/base.html2
-rw-r--r--ogcp/templates/macros.html9
2 files changed, 6 insertions, 5 deletions
diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html
index 0037f79..3ac4f5d 100644
--- a/ogcp/templates/base.html
+++ b/ogcp/templates/base.html
@@ -111,7 +111,7 @@
<!-- ChartJS -->
<script src="{{ url_for('static', filename='AdminLTE/plugins/chart.js/Chart.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=6"></script>
+ <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=7"></script>
<script>
// error messages
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index 228c393..c6cd15e 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -11,14 +11,15 @@
showSelectedClientsOnEvents();
updateScopeState();
keepScopesTreeState();
+ let context = {{ selection_mode | tojson | safe }};
{% if selection_mode == 'commands' %}
- keepSelectedClients();
- checkChildrenCheckboxes();
+ checkChildrenCheckboxes(context);
checkParentsCheckboxes();
{% elif selection_mode == 'scopes' %}
- limitCheckboxes();
- checkFolderParent();
+ limitCheckboxes(context);
+ checkFolderParent(context);
{% endif %}
+ keepSelectedClients(context);
}
});
</script>