mirror of https://git.48k.eu/ogcp
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.multi-ogserver
parent
406f578597
commit
feed135554
|
@ -1,6 +1,8 @@
|
|||
{% extends 'scopes.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_center %} active{% endblock %}
|
||||
{% block nav_center_add %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'scopes.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_room %} active{% endblock %}
|
||||
{% block nav_room_add %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends parent %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_client %} active{% endblock %}
|
||||
{% block nav_client_details %} active{% endblock %}
|
||||
{% block nav_client_add %}active{% endblock %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'scopes.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_center %} active{% endblock %}
|
||||
{% block nav_center_delete %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_client %} active{% endblock %}
|
||||
{% block nav_client_delete %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'images.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{{ args }}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'scopes.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_room %} active{% endblock %}
|
||||
{% block nav_room_delete %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_inventory %} active{% endblock %}
|
||||
{% block nav_inventory_hardware %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_image %} active{% endblock %}
|
||||
{% block nav_image_create %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_image %} active{% endblock %}
|
||||
{% block nav_image_restore %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_setup %} active{% endblock %}
|
||||
{% block nav_setup_set_bootmode %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_setup %} active{% endblock %}
|
||||
{% block nav_setup_set_oglive %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_power %} active{% endblock %}
|
||||
{% block nav_power_poweroff %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_power %} active{% endblock %}
|
||||
{% block nav_power_reboot %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_client %} active{% endblock %}
|
||||
{% block nav_client_session %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{% extends 'commands.html' %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_setup %} active{% endblock %}
|
||||
{% block nav_setup_setup %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_inventory %} active{% endblock %}
|
||||
{% block nav_inventory_software %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'commands.html' %}
|
||||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_inventory %} active{% endblock %}
|
||||
{% block nav_inventory_software %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{% import "bootstrap/wtf.html" as wtf %}
|
||||
{% import "macros.html" as macros %}
|
||||
|
||||
{% set sidebar_state = 'disabled' %}
|
||||
|
||||
{% block nav_power %} active{% endblock %}
|
||||
{% block nav_power_wol %} active{% endblock %}
|
||||
{% block content %}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ macros.scopes_tree_collapse(scopes) }}
|
||||
{{ macros.scopes_tree_collapse(scopes, sidebar_state) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block commands %}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ macros.scopes_tree_collapse(scopes) }}
|
||||
{{ macros.scopes_tree_collapse(scopes, sidebar_status) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block commands %}
|
||||
|
|
Loading…
Reference in New Issue