From c3a2dc028db95530bf078aafc05270a110a556d1 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Fri, 14 Jun 2024 10:47:32 +0200 Subject: forms: use checkboxes for scope selection in UserForm Enable selection of multiple scopes in user/add and user/edit for restricted users. Replace quick form creation with an inline form definition in add_user.html and edit_user.html --- ogcp/forms/auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ogcp/forms') diff --git a/ogcp/forms/auth.py b/ogcp/forms/auth.py index 526fdb0..ba7a545 100644 --- a/ogcp/forms/auth.py +++ b/ogcp/forms/auth.py @@ -7,7 +7,7 @@ from wtforms import ( Form, SubmitField, HiddenField, SelectField, BooleanField, IntegerField, - StringField, RadioField, PasswordField, SelectMultipleField + StringField, RadioField, PasswordField, SelectMultipleField, widgets ) from wtforms.validators import InputRequired from flask_wtf import FlaskForm @@ -47,6 +47,8 @@ class UserForm(FlaskForm): scopes = SelectMultipleField( label=_l('Allowed scopes'), description=_l('Leave this empty to give full permissions'), + option_widget=widgets.CheckboxInput(), + widget=widgets.ListWidget(prefix_label=False) ) submit_btn = SubmitField( label=_l('Submit') -- cgit v1.2.3-18-g5258