summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
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 /ogcp/views.py
parent4005b019ee013c223a6ca3b31dd8fb7799c838d1 (diff)
Extend scopes html
Otherwise, this actions pages lose the scopes tree and the scopes buttons.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py16
1 files changed, 12 insertions, 4 deletions
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