summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-03-03 12:25:31 +0100
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-03-03 12:25:31 +0100
commitb0fb32d7673e2d892b4645cee8e16f7f157e26f6 (patch)
tree642feb8d3dafe3fdc10cdf8061151a5a7af32e1c
parent4005b019ee013c223a6ca3b31dd8fb7799c838d1 (diff)
Extend scopes html
Otherwise, this actions pages lose the scopes tree and the scopes buttons.
-rw-r--r--ogcp/templates/actions/add_center.html2
-rw-r--r--ogcp/templates/actions/add_room.html2
-rw-r--r--ogcp/templates/actions/delete_center.html2
-rw-r--r--ogcp/templates/actions/delete_room.html2
-rw-r--r--ogcp/views.py16
5 files changed, 16 insertions, 8 deletions
diff --git a/ogcp/templates/actions/add_center.html b/ogcp/templates/actions/add_center.html
index 10759c7..59ab450 100644
--- a/ogcp/templates/actions/add_center.html
+++ b/ogcp/templates/actions/add_center.html
@@ -1,4 +1,4 @@
-{% extends 'base.html' %}
+{% extends 'scopes.html' %}
{% import "bootstrap/wtf.html" as wtf %}
{% block content %}
diff --git a/ogcp/templates/actions/add_room.html b/ogcp/templates/actions/add_room.html
index dffdc87..d3ecc8b 100644
--- a/ogcp/templates/actions/add_room.html
+++ b/ogcp/templates/actions/add_room.html
@@ -1,4 +1,4 @@
-{% extends 'base.html' %}
+{% extends 'scopes.html' %}
{% import "bootstrap/wtf.html" as wtf %}
{% block content %}
diff --git a/ogcp/templates/actions/delete_center.html b/ogcp/templates/actions/delete_center.html
index 3a01c93..1a52cdd 100644
--- a/ogcp/templates/actions/delete_center.html
+++ b/ogcp/templates/actions/delete_center.html
@@ -1,4 +1,4 @@
-{% extends 'base.html' %}
+{% extends 'scopes.html' %}
{% import "bootstrap/wtf.html" as wtf %}
{% block content %}
diff --git a/ogcp/templates/actions/delete_room.html b/ogcp/templates/actions/delete_room.html
index a5aa529..1761bb3 100644
--- a/ogcp/templates/actions/delete_room.html
+++ b/ogcp/templates/actions/delete_room.html
@@ -1,4 +1,4 @@
-{% extends 'base.html' %}
+{% extends 'scopes.html' %}
{% import "bootstrap/wtf.html" as wtf %}
{% block content %}
diff --git a/ogcp/views.py b/ogcp/views.py
index d4c74a1..ae67b1e 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -908,7 +908,9 @@ def action_center_add():
flash(_('Center added successfully'), category='info')
return redirect(url_for("scopes"))
else:
- return render_template('actions/add_center.html', form=form)
+ scopes, clients = get_scopes()
+ return render_template('actions/add_center.html', form=form,
+ scopes=scopes)
@app.route('/action/center/delete', methods=['GET', 'POST'])
@login_required
@@ -928,7 +930,9 @@ def action_center_delete():
centers = parse_scopes_from_tree(r.json(), 'center')
centers = [(center['id'], center['name']) for center in centers]
form.center.choices = list(centers)
- return render_template('actions/delete_center.html', form=form)
+ scopes, clients = get_scopes()
+ return render_template('actions/delete_center.html', form=form,
+ scopes=scopes)
@app.route('/action/room/add', methods=['GET', 'POST'])
@login_required
@@ -949,7 +953,9 @@ def action_room_add():
centers = parse_scopes_from_tree(r.json(), 'center')
centers = [(center['id'], center['name']) for center in centers]
form.center.choices = list(centers)
- return render_template('actions/add_room.html', form=form)
+ scopes, clients = get_scopes()
+ return render_template('actions/add_room.html', form=form,
+ scopes=scopes)
@app.route('/action/room/delete', methods=['GET', 'POST'])
@login_required
@@ -970,7 +976,9 @@ def action_room_delete():
rooms = [(room['id'], room['name'] + " (" + room['parent'] + ")")
for room in rooms]
form.room.choices = list(rooms)
- return render_template('actions/delete_room.html', form=form)
+ scopes, clients = get_scopes()
+ return render_template('actions/delete_room.html', form=form,
+ scopes=scopes)
@app.route('/commands/', methods=['GET'])
@login_required