summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/macros.html
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-03-10 11:00:17 +0100
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-03-10 11:03:40 +0100
commitfeed13555454335355063f6b06dd9f035c5369ae (patch)
tree825c52cc0599aef0091b1109751b655552d8d740 /ogcp/templates/macros.html
parent406f578597b283cd555d3b82e6743e6ace8808d2 (diff)
Disable scopes tree's checkboxes in action views
Now users can select clients only in scopes and command views, in any other view we set the scopes tree read only.
Diffstat (limited to 'ogcp/templates/macros.html')
-rw-r--r--ogcp/templates/macros.html10
1 files changed, 5 insertions, 5 deletions
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index 19ec8c7..fed48a6 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -1,7 +1,7 @@
-{% macro scopes_tree_collapse(scopes) -%}
+{% macro scopes_tree_collapse(scopes, state='') -%}
<ul id="scopes" class="nav flex-column nav-pills">
- {{ scopes_tree_collapse_level(scopes["scope"], 1, "") }}
+ {{ scopes_tree_collapse_level(scopes["scope"], 1, "", state) }}
</ul>
<script>
// Launch the javascript on document ready, so all the global functions exists
@@ -19,12 +19,12 @@
{% endmacro %}
-{% macro scopes_tree_collapse_level(scopes, i, parent_id) -%}
+{% macro scopes_tree_collapse_level(scopes, i, parent_id, state) -%}
{% for scope in scopes %}
<li id="{{ scope["name"]|replace(".", "_") }}_{{ scope["id"] }}" class="nav-item">
{% if " ".join(scope["ip"]) %}
<input class="form-check-input" type="checkbox" form="scopesForm"
- value="{{ " ".join(scope["ip"]) }}"
+ value="{{ " ".join(scope["ip"]) }}" {{ state }}
{% if scope.get("selected", False) %}checked{% endif %}
name="{{ scope["name"] }}_{{ scope["id"] }}" />
{% endif %}
@@ -42,7 +42,7 @@
</a>
{% if scope["scope"] %}
<ul class="nav flex-column collapse level{{i}}" id="id{{parent_id ~ "_" ~ i ~ "-" ~ loop.index}}">
- {{ scopes_tree_collapse_level(scope["scope"], i + 1, parent_id ~ "_" ~ i ~ "-" ~ loop.index) }}
+ {{ scopes_tree_collapse_level(scope["scope"], i + 1, parent_id ~ "_" ~ i ~ "-" ~ loop.index, state) }}
</ul>
{% endif %}
</li>