From eb8ddd236acac593cce7c341d84a5ab3da834aff Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Wed, 27 Apr 2022 17:19:54 +0200 Subject: Add 'Edit user' to Users section Creates "Edit user" form with the following inputs: password, password confirmation, role (administrator or regular), allowed scopes. It does no allow to change/edit the username. --- ogcp/templates/auth/edit_user.html | 26 +++++++++++++++++ ogcp/templates/users.html | 2 ++ ogcp/views.py | 60 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 ogcp/templates/auth/edit_user.html (limited to 'ogcp') diff --git a/ogcp/templates/auth/edit_user.html b/ogcp/templates/auth/edit_user.html new file mode 100644 index 0000000..9e1b2b9 --- /dev/null +++ b/ogcp/templates/auth/edit_user.html @@ -0,0 +1,26 @@ +{% extends 'users.html' %} +{% import "bootstrap/wtf.html" as wtf %} + +{% set sidebar_state = 'disabled' %} +{% set btn_back = true %} + +{% block nav_user_edit %}active{% endblock %} +{% block content %} + +

{{_('Edit user {}').format(form.username.data)}}

+ +{{ wtf.quick_form(form, + action=url_for('user_edit_post'), + method='post', + button_map={'submit_btn':'primary'}, + id='user-form') }} + + + +{% endblock %} diff --git a/ogcp/templates/users.html b/ogcp/templates/users.html index c14aae6..6dd056b 100644 --- a/ogcp/templates/users.html +++ b/ogcp/templates/users.html @@ -26,6 +26,8 @@ {% block commands %} + {% if btn_back %}