summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-17 12:52:32 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-17 14:03:00 +0200
commit4a74de1064c6cf0ef9ce10934efa24b63e661083 (patch)
tree5da99ed64437aaee27b037313f62940853905930 /ogcp/templates
parent664ad2bf7bad8014c024ce1b0f247f394a2fcaa4 (diff)
ogcp: add move client to scopes management
Add front end for the client/move REST API. Enable the move of multiple clients selected from the sidebar of Scopes Management. Show the target of the move operation as a list of paths in a dropdown widget in the form. Each path will be structured as: Server/Center/Room The path will also contain folders if they are present.
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/actions/client_move.html25
-rw-r--r--ogcp/templates/scopes.html2
2 files changed, 27 insertions, 0 deletions
diff --git a/ogcp/templates/actions/client_move.html b/ogcp/templates/actions/client_move.html
new file mode 100644
index 0000000..d9bcaac
--- /dev/null
+++ b/ogcp/templates/actions/client_move.html
@@ -0,0 +1,25 @@
+{% extends 'scopes.html' %}
+{% import "bootstrap/wtf.html" as wtf %}
+{% import "macros.html" as macros %}
+
+{% set sidebar_state = 'disabled' %}
+{% set btn_back = true %}
+
+{% block nav_client %} active {% endblock %}
+{% block nav_client_move %} active {% endblock %}
+{% block content %}
+
+{% set ip_list = form.ips.data.split(' ') %}
+{% set ip_count = ip_list | length %}
+<h1 class="m-5">
+ {{ _('Move %(ip_count)d client(s)', ip_count=ip_count) }}
+</h1>
+
+{{ macros.cmd_selected_clients(selected_clients) }}
+
+{{ wtf.quick_form(form,
+ method='post',
+ button_map={'submit': 'primary'},
+ extra_classes="mx-5") }}
+
+{% endblock %}
diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html
index 0dde6a6..a96ae62 100644
--- a/ogcp/templates/scopes.html
+++ b/ogcp/templates/scopes.html
@@ -26,6 +26,8 @@
form="scopesForm" formaction="{{ url_for('action_client_add') }}" formmethod="get">
<input class="btn btn-light dropdown-item {% block nav_client_update %}{% endblock %}" type="submit" value="{{ _('Edit client') }}"
form="scopesForm" formaction="{{ url_for('action_client_update') }}" formmethod="get">
+ <input class="btn btn-light dropdown-item {% block nav_client_move %}{% endblock %}" type="submit" value="{{ _('Move client') }}"
+ form="scopesForm" formaction="{{ url_for('action_client_move') }}" formmethod="get">
<input class="btn btn-light dropdown-item {% block nav_clients_import %}{% endblock %}" type="submit" value="{{ _('Import clients') }}"
form="scopesForm" formaction="{{ url_for('action_clients_import_get') }}" formmethod="get">
<input class="btn btn-light dropdown-item {% block nav_client_delete %}{% endblock %}" type="submit" value="{{ _('Delete client') }}"