From 51346c4860e3dc1882c339b4915d9c4eae84a9c6 Mon Sep 17 00:00:00 2001 From: DjVinnii Date: Thu, 1 Apr 2021 18:30:13 +0200 Subject: [PATCH] Fix pre- and append styling --- core/admin/mailu/ui/templates/alias/create.html | 2 +- core/admin/mailu/ui/templates/client.html | 2 ++ core/admin/mailu/ui/templates/domain/create.html | 2 +- core/admin/mailu/ui/templates/domain/signup.html | 2 +- core/admin/mailu/ui/templates/macros.html | 7 ++++--- core/admin/mailu/ui/templates/user/create.html | 4 ++-- core/admin/mailu/ui/templates/user/settings.html | 2 +- core/admin/mailu/ui/templates/user/signup.html | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/admin/mailu/ui/templates/alias/create.html b/core/admin/mailu/ui/templates/alias/create.html index 4b0ea3e2..2079d191 100644 --- a/core/admin/mailu/ui/templates/alias/create.html +++ b/core/admin/mailu/ui/templates/alias/create.html @@ -12,7 +12,7 @@ {% call macros.card() %}
{{ form.hidden_tag() }} - {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} + {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} {{ macros.form_field(form.wildcard) }} {{ macros.form_field(form.destination, class_='mailselect') }} {{ macros.form_field(form.comment) }} diff --git a/core/admin/mailu/ui/templates/client.html b/core/admin/mailu/ui/templates/client.html index 1fdcb7cb..668621af 100644 --- a/core/admin/mailu/ui/templates/client.html +++ b/core/admin/mailu/ui/templates/client.html @@ -1,3 +1,5 @@ + + {% extends "base.html" %} {% block title %} diff --git a/core/admin/mailu/ui/templates/domain/create.html b/core/admin/mailu/ui/templates/domain/create.html index d84159b1..3fdd262a 100644 --- a/core/admin/mailu/ui/templates/domain/create.html +++ b/core/admin/mailu/ui/templates/domain/create.html @@ -11,7 +11,7 @@ {{ macros.form_field(form.name) }} {{ macros.form_fields((form.max_users, form.max_aliases)) }} {{ macros.form_field(form.max_quota_bytes, step=1000000000, max=50000000000, - prepend=''+((form.max_quota_bytes.data//1000000000).__str__() if form.max_quota_bytes.data else '∞')+' GiB', + prepend=''+((form.max_quota_bytes.data//1000000000).__str__() if form.max_quota_bytes.data else '∞')+' GiB', oninput='$("#quota").text(this.value == 0 ? "∞" : this.value/1000000000);') }} {{ macros.form_field(form.signup_enabled) }} {{ macros.form_field(form.comment) }} diff --git a/core/admin/mailu/ui/templates/domain/signup.html b/core/admin/mailu/ui/templates/domain/signup.html index 77b7fec9..e9dbd75f 100644 --- a/core/admin/mailu/ui/templates/domain/signup.html +++ b/core/admin/mailu/ui/templates/domain/signup.html @@ -24,7 +24,7 @@ {% call macros.card() %} {% if form.localpart %} - {{ macros.form_fields((form.localpart, form.name), append='@') }} + {{ macros.form_fields((form.localpart, form.name), append='@') }} {{ macros.form_fields((form.pw, form.pw2)) }} {% else %} {{ macros.form_field(form.name) }} diff --git a/core/admin/mailu/ui/templates/macros.html b/core/admin/mailu/ui/templates/macros.html index 5acc5bed..a53d85c7 100644 --- a/core/admin/mailu/ui/templates/macros.html +++ b/core/admin/mailu/ui/templates/macros.html @@ -37,9 +37,10 @@ {{ field.label if label else '' }} {% else %} {{ field.label if label else '' }}{{ form_field_errors(field) }} - {% if prepend or append %}
{% endif %} - {{ prepend|safe }}{{ field(class_="form-control " + class_, **kwargs) }}{{ append|safe }} - {% if prepend or append %}
{% endif %} + {% if prepend %}
{% endif %} + {% if append %}
{% endif %} + {{ prepend|safe }}{{ field(class_="form-control " + class_, **kwargs) }}{{ append|safe }} + {% if prepend or append %}
{% endif %} {% endif %} {% endmacro %} diff --git a/core/admin/mailu/ui/templates/user/create.html b/core/admin/mailu/ui/templates/user/create.html index a28c7048..886cbb88 100644 --- a/core/admin/mailu/ui/templates/user/create.html +++ b/core/admin/mailu/ui/templates/user/create.html @@ -13,7 +13,7 @@ {{ form.hidden_tag() }} {% call macros.card(_("General")) %} - {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} + {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} {{ macros.form_fields((form.pw, form.pw2)) }} {{ macros.form_field(form.displayed_name) }} {{ macros.form_field(form.comment) }} @@ -22,7 +22,7 @@ {% call macros.card(_("Features and quotas"), theme="success") %} {{ macros.form_field(form.quota_bytes, step=1000000000, max=(max_quota_bytes or domain.max_quota_bytes or 50000000000), - prepend=''+((form.quota_bytes.data//1000000000).__str__() if form.quota_bytes.data else '∞')+' GiB', + prepend=''+((form.quota_bytes.data//1000000000).__str__() if form.quota_bytes.data else '∞')+' GiB', oninput='$("#quota").text(this.value == 0 ? "∞" : this.value/1000000000);') }} {{ macros.form_field(form.enable_imap) }} {{ macros.form_field(form.enable_pop) }} diff --git a/core/admin/mailu/ui/templates/user/settings.html b/core/admin/mailu/ui/templates/user/settings.html index e58cc89a..9aa672ca 100644 --- a/core/admin/mailu/ui/templates/user/settings.html +++ b/core/admin/mailu/ui/templates/user/settings.html @@ -19,7 +19,7 @@ {% call macros.card(title=_("Antispam")) %} {{ macros.form_field(form.spam_enabled) }} {{ macros.form_field(form.spam_threshold, step=1, max=100, - prepend=''+form.spam_threshold.data.__str__()+' / 100', + prepend=''+form.spam_threshold.data.__str__()+' / 100', oninput='$("#threshold").text(this.value);') }} {% endcall %} diff --git a/core/admin/mailu/ui/templates/user/signup.html b/core/admin/mailu/ui/templates/user/signup.html index 2b20bde9..1157cfa3 100644 --- a/core/admin/mailu/ui/templates/user/signup.html +++ b/core/admin/mailu/ui/templates/user/signup.html @@ -12,7 +12,7 @@ {{ form.hidden_tag() }} {% call macros.card() %} - {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} + {{ macros.form_field(form.localpart, append='@'+domain.name+'') }} {{ macros.form_fields((form.pw, form.pw2)) }} {% if form.captcha %} {{ macros.form_field(form.captcha) }}