summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorDaniel García Moreno <danigm@soleta.eu>2022-09-13 12:01:23 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-27 09:48:36 +0200
commitefe97317534942c97bfbc132e096655b8191105f (patch)
tree88237db1120a3bf4daeff0233a82505f269a098e /ogcp/templates
parent1db12230f94c33c8d701f4af5ea3fd48e76c4dad (diff)
Add different selection mode for the tree view
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/commands.html2
-rw-r--r--ogcp/templates/macros.html12
-rw-r--r--ogcp/templates/scopes.html2
3 files changed, 10 insertions, 6 deletions
diff --git a/ogcp/templates/commands.html b/ogcp/templates/commands.html
index dfcda91..c212600 100644
--- a/ogcp/templates/commands.html
+++ b/ogcp/templates/commands.html
@@ -12,7 +12,7 @@
{% endblock %}
{% block sidebar %}
- {{ macros.scopes_tree_collapse(scopes, sidebar_state) }}
+ {{ macros.scopes_tree_collapse(scopes, sidebar_state, 'commands') }}
{% endblock %}
{% block commands %}
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index 0283d26..a8e4f87 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -1,4 +1,4 @@
-{% macro scopes_tree_collapse(scopes, state='') -%}
+{% macro scopes_tree_collapse(scopes, state='', selection_mode='scopes') -%}
<ul id="scopes" class="nav flex-column nav-pills">
{{ scopes_tree_collapse_level(scopes["scope"], "", state) }}
@@ -11,9 +11,13 @@
showSelectedClientsOnEvents();
updateScopeState();
keepScopesTreeState();
- keepSelectedClients();
- checkChildrenCheckboxes();
- checkParentsCheckboxes();
+ {% if selection_mode == 'commands' %}
+ keepSelectedClients();
+ checkChildrenCheckboxes();
+ checkParentsCheckboxes();
+ {% elif selection_mode == 'scopes' %}
+ limitCheckboxes();
+ {% endif %}
}
});
</script>
diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html
index 751272d..d07e7d3 100644
--- a/ogcp/templates/scopes.html
+++ b/ogcp/templates/scopes.html
@@ -12,7 +12,7 @@
{% endblock %}
{% block sidebar %}
- {{ macros.scopes_tree_collapse(scopes, sidebar_state) }}
+ {{ macros.scopes_tree_collapse(scopes, sidebar_state, 'scopes') }}
{% endblock %}
{% block commands %}