From d8bac16a980634f182e9c753a01e114c3a482af0 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 26 Apr 2022 15:08:19 +0200 Subject: Add Users section In Users section/view, administrator accounts can manage all task related to users. For example: add, delete and edit users. --- ogcp/templates/base.html | 5 +++++ ogcp/templates/users.html | 33 +++++++++++++++++++++++++++++++++ ogcp/views.py | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 ogcp/templates/users.html diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index c67dd9b..0ec773c 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -36,6 +36,11 @@ + {% if current_user.admin %} + + {% endif %} {% endif %} diff --git a/ogcp/templates/users.html b/ogcp/templates/users.html new file mode 100644 index 0000000..c97f113 --- /dev/null +++ b/ogcp/templates/users.html @@ -0,0 +1,33 @@ +{% extends 'base.html' %} + +{% block nav_users %}active{% endblock %} + +{% block container %} +
+ +
+ {{ super() }} + +{% endblock %} + +{% block sidebar %} + +{% endblock %} + +{% block commands %} + {% if btn_back %} + + {% endif %} +{% endblock %} + diff --git a/ogcp/views.py b/ogcp/views.py index d1e4109..c10d2c0 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1186,6 +1186,14 @@ def images(): images = r.json()['images'] return render_template('images.html', images=images) + +@app.route('/users/', methods=['GET']) +@login_required +def users(): + users = app.config['USERS'] + return render_template('users.html', users=users) + + @app.route('/action/image/info', methods=['GET']) @login_required def action_image_info(): -- cgit v1.2.3-18-g5258