summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorDaniel García Moreno <danigm@soleta.eu>2022-09-13 13:02:36 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-27 09:48:36 +0200
commitea182079989407e382917d95cc86c77dbee7bff8 (patch)
treed7dab24c242a9c19da021cdc46efc8273e259d6f /ogcp/templates
parentefe97317534942c97bfbc132e096655b8191105f (diff)
Implement single room selection for commands view
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/macros.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index a8e4f87..ce457ec 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -1,7 +1,7 @@
{% 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) }}
+ {{ scopes_tree_collapse_level(scopes["scope"], "", state, selection_mode) }}
</ul>
<script>
// Launch the javascript on document ready, so all the global functions exists
@@ -24,7 +24,7 @@
{% endmacro %}
-{% macro scopes_tree_collapse_level(scopes, parent_id, state) -%}
+{% macro scopes_tree_collapse_level(scopes, parent_id, state, selection_mode) -%}
{% for scope in scopes %}
<li id="{{ scope["name"]|replace(".", "_")|replace(" ", "_") }}_{{ scope["id"] }}" class="nav-item">
{% if scope["type"] == "server" %}
@@ -33,11 +33,13 @@
{% if scope.get("selected", False) %}checked{% endif %}
name="scope-server" hidden/>
{% elif scope["type"] == "center" %}
+ {% if selection_mode != "commands" %}
<input class="form-check-input" type="checkbox" form="scopesForm"
value="{{ scope["id"] }}"
{% if state %}style="filter: grayscale(100%);" onclick="return false;"{% endif %}
{% if scope.get("selected", False) %}checked{% endif %}
name="scope-center" />
+ {% endif %}
{% elif scope["type"] == "room" %}
<input class="form-check-input" type="checkbox" form="scopesForm"
value="{{ scope["id"] }}"
@@ -65,7 +67,7 @@
</a>
{% if scope["scope"] %}
<ul class="nav flex-column collapse level{{i}}" id="scope{{parent_id ~ "-" ~ loop.index}}">
- {{ scopes_tree_collapse_level(scope["scope"], parent_id ~ "-" ~ loop.index, state) }}
+ {{ scopes_tree_collapse_level(scope["scope"], parent_id ~ "-" ~ loop.index, state, selection_mode) }}
</ul>
{% endif %}
</li>