From 97e79a973f1ebd1e3d586cb318f0a7484cc4313e Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 4 Nov 2021 08:32:53 +0100 Subject: [PATCH] fix sso login button spacing again --- core/admin/mailu/sso/templates/form_sso.html | 2 +- core/admin/mailu/sso/views/base.py | 1 + core/admin/mailu/ui/templates/macros.html | 14 ++++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/admin/mailu/sso/templates/form_sso.html b/core/admin/mailu/sso/templates/form_sso.html index b14e7600..d2451597 100644 --- a/core/admin/mailu/sso/templates/form_sso.html +++ b/core/admin/mailu/sso/templates/form_sso.html @@ -5,7 +5,7 @@
{{ macros.form_field(form.email) }} {{ macros.form_field(form.pw) }} - {{ macros.form_fields(fields, label=False, class="btn btn-default", spacing=False) }} + {{ macros.form_fields(fields, label=False, class="btn btn-default") }}
{%- endcall %} {%- endblock %} diff --git a/core/admin/mailu/sso/views/base.py b/core/admin/mailu/sso/views/base.py index fbee52a7..e948aeb7 100644 --- a/core/admin/mailu/sso/views/base.py +++ b/core/admin/mailu/sso/views/base.py @@ -19,6 +19,7 @@ def login(): fields.append(form.submitAdmin) if str(app.config["WEBMAIL"]).upper() != "NONE": fields.append(form.submitWebmail) + fields = [fields] if form.validate_on_submit(): if form.submitAdmin.data: diff --git a/core/admin/mailu/ui/templates/macros.html b/core/admin/mailu/ui/templates/macros.html index 75de4e0e..3b7e4c1d 100644 --- a/core/admin/mailu/ui/templates/macros.html +++ b/core/admin/mailu/ui/templates/macros.html @@ -18,17 +18,19 @@ {%- endif %} {%- endmacro %} -{%- macro form_fields(fields, prepend='', append='', label=True, spacing=True) %} - {%- if spacing %} +{%- macro form_fields(fields, prepend='', append='', label=True) %} {%- set width = (12 / fields|length)|int %} - {%- else %} - {%- set width = 2 %} - {% endif %}
{%- for field in fields %}
- {{ form_individual_field(field, prepend=prepend, append=append, label=label, **kwargs) }} + {%- if field is iterable %} + {%- for subfield in field %} + {{ form_individual_field(subfield, prepend=prepend, append=append, label=label, **kwargs) }} + {%- endfor %} + {%- else %} + {{ form_individual_field(field, prepend=prepend, append=append, label=label, **kwargs) }} + {%- endif %}
{%- endfor %}