From 98dbc2f2903887017ef55ce571bc5859918678b3 Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Fri, 15 Mar 2024 15:07:23 +0100 Subject: [PATCH 01/10] add wtforms_widgets submodule --- .gitmodules | 4 ++++ build/requirements/requirements.txt | 1 + wtforms_widgets | 1 + 3 files changed, 6 insertions(+) create mode 100644 .gitmodules create mode 160000 wtforms_widgets diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..18b16248 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "wtforms_widgets"] + path = wtforms_widgets + url = https://github.com/agdsn/wtforms-widgets.git + branch = pycroft diff --git a/build/requirements/requirements.txt b/build/requirements/requirements.txt index 43d52113..5c45f0d7 100644 --- a/build/requirements/requirements.txt +++ b/build/requirements/requirements.txt @@ -24,3 +24,4 @@ recurring_ical_events~=1.0.2b0 cachetools~=5.2.0 python-dotenv~=0.21.0 pydantic~=2.4.2 +-e wtforms_widgets diff --git a/wtforms_widgets b/wtforms_widgets new file mode 160000 index 00000000..bb423ae6 --- /dev/null +++ b/wtforms_widgets @@ -0,0 +1 @@ +Subproject commit bb423ae68b5339c069c4fe615a961f947eccb917 From cbefa8500ee2b232e7f16d2f1a99de0c14805730 Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Fri, 15 Mar 2024 16:30:56 +0100 Subject: [PATCH 02/10] Fix (but also break) layout The implicit assumption in wtforms_widgets is to leave a 4fr (of 12fr) gap to the right of the form. That needs to be fixed. --- sipa/initialization.py | 2 +- sipa/templates/login.html | 8 ++++++-- sipa/templates/macros/forms.html | 29 +++++++---------------------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/sipa/initialization.py b/sipa/initialization.py index 8d76de74..fc28b670 100644 --- a/sipa/initialization.py +++ b/sipa/initialization.py @@ -82,7 +82,7 @@ def init_app(app, **kwargs): logger.debug('Registering Jinja globals') form_label_width = 4 - form_input_width = 8 + form_input_width = 4 app.jinja_env.globals.update( current_user=current_user, cf_pages=cf_pages, diff --git a/sipa/templates/login.html b/sipa/templates/login.html index 6df90102..75202c76 100644 --- a/sipa/templates/login.html +++ b/sipa/templates/login.html @@ -5,8 +5,12 @@ {% block content %} {% include "heading.html" %} {% call forms.render(form=form, form_id="loginform", cancel_to=url_for('.index')) %} -