diff options
Diffstat (limited to 'ogcp/templates/macros.html')
-rw-r--r-- | ogcp/templates/macros.html | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html index e78cb5b..a00556f 100644 --- a/ogcp/templates/macros.html +++ b/ogcp/templates/macros.html @@ -17,6 +17,7 @@ checkParentsCheckboxes(); {% elif selection_mode == 'scopes' %} limitCheckboxes(); + checkFolderParent(); {% endif %} } }); @@ -27,14 +28,15 @@ {% macro scopes_tree_collapse_level(scopes, parent_room, parent_id, state, selection_mode) -%} {% for scope in scopes %} <li id="{{ scope["name"]|replace(".", "_")|replace(" ", "_") }}_{{ scope["id"] }}" class="nav-item"> + {% set input_id = "input" ~ parent_id ~ "-" ~ loop.index %} {% if scope["type"] == "server" %} - <input class="form-check-input" type="checkbox" form="scopesForm" + <input id="{{ input_id }}" class="form-check-input" type="checkbox" form="scopesForm" value="{{ scope["server_ip_port"] }}" onclick="return false;" {% 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" + <input id="{{ input_id }}" 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 %} @@ -42,19 +44,19 @@ {% endif %} {% elif scope["type"] == "room" %} {% set parent_room = scope.name + "-" + scope.id|string %} - <input class="form-check-input" type="checkbox" form="scopesForm" + <input id="{{ input_id }}" class="form-check-input" type="checkbox" form="scopesForm" value="{{ scope["id"] }}" data-room="{{ parent_room }}" {% if state %}style="filter: grayscale(100%);" onclick="return false;"{% endif %} {% if scope.get("selected", False) %}checked{% endif %} name="scope-room" /> {% elif scope["type"] == "folder" %} - <input class="form-check-input" type="checkbox" form="scopesForm" - value="{{ scope["id"] }}" + <input id="{{ input_id }}" class="form-check-input" type="checkbox" form="scopesForm" + value="{{ scope["id"] }}" data-parent-input="{{ "input" ~ parent_id }}" {% if state %}style="filter: grayscale(100%);" onclick="return false;"{% endif %} {% if scope.get("selected", False) %}checked{% endif %} name="folder" /> {% elif " ".join(scope["ip"]) %} - <input class="form-check-input" type="checkbox" form="scopesForm" + <input id="{{ input_id }}" class="form-check-input" type="checkbox" form="scopesForm" value="{{ " ".join(scope["ip"]) }}" data-parent-room="{{ parent_room }}" {% if state %}style="filter: grayscale(100%);" onclick="return false;"{% endif %} {% if scope.get("selected", False) %}checked{% endif %} |