From 6218b363726c3340769a2eb125a88572b1908045 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 11 Jan 2022 16:49:39 +0100 Subject: [PATCH 1/6] configure datatables via html5 data attributes --- core/admin/mailu/ui/templates/admin/list.html | 2 +- core/admin/mailu/ui/templates/alias/list.html | 6 +++--- .../admin/mailu/ui/templates/alternative/list.html | 6 +++--- core/admin/mailu/ui/templates/domain/list.html | 14 +++++++------- core/admin/mailu/ui/templates/fetch/list.html | 6 +++--- core/admin/mailu/ui/templates/macros.html | 4 ++-- core/admin/mailu/ui/templates/relay/list.html | 8 ++++---- core/admin/mailu/ui/templates/token/list.html | 6 +++--- core/admin/mailu/ui/templates/user/list.html | 12 ++++++------ 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/core/admin/mailu/ui/templates/admin/list.html b/core/admin/mailu/ui/templates/admin/list.html index 84d954a0..e50c0ee6 100644 --- a/core/admin/mailu/ui/templates/admin/list.html +++ b/core/admin/mailu/ui/templates/admin/list.html @@ -14,7 +14,7 @@ {%- call macros.table() %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Email{% endtrans %} diff --git a/core/admin/mailu/ui/templates/alias/list.html b/core/admin/mailu/ui/templates/alias/list.html index 1e66668e..93b6fa73 100644 --- a/core/admin/mailu/ui/templates/alias/list.html +++ b/core/admin/mailu/ui/templates/alias/list.html @@ -16,7 +16,7 @@ {%- call macros.table() %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Email{% endtrans %} {% trans %}Destination{% endtrans %} {% trans %}Comment{% endtrans %} @@ -34,8 +34,8 @@ {{ alias }} {{ alias.destination|join(', ') or '-' }} {{ alias.comment or '' }} - {{ alias.created_at | format_date }} - {{ alias.updated_at | format_date }} + {{ alias.created_at | format_date }} + {{ alias.updated_at | format_date }} {%- endfor %} diff --git a/core/admin/mailu/ui/templates/alternative/list.html b/core/admin/mailu/ui/templates/alternative/list.html index 4ca9f3c8..bc018c3d 100644 --- a/core/admin/mailu/ui/templates/alternative/list.html +++ b/core/admin/mailu/ui/templates/alternative/list.html @@ -16,7 +16,7 @@ {%- call macros.table() %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Name{% endtrans %} {% trans %}Created{% endtrans %} {% trans %}Last edit{% endtrans %} @@ -29,8 +29,8 @@ {{ alternative }} - {{ alternative.created_at | format_date }} - {{ alternative.updated_at | format_date }} + {{ alternative.created_at | format_date }} + {{ alternative.updated_at | format_date }} {%- endfor %} diff --git a/core/admin/mailu/ui/templates/domain/list.html b/core/admin/mailu/ui/templates/domain/list.html index 61c09151..a6cefe9e 100644 --- a/core/admin/mailu/ui/templates/domain/list.html +++ b/core/admin/mailu/ui/templates/domain/list.html @@ -11,11 +11,11 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[2,"asc"]]') %} - {% trans %}Actions{% endtrans %} - {% trans %}Manage{% endtrans %} + {% trans %}Actions{% endtrans %} + {% trans %}Manage{% endtrans %} {% trans %}Domain name{% endtrans %} {% trans %}Mailbox count{% endtrans %} {% trans %}Alias count{% endtrans %} @@ -43,11 +43,11 @@ {%- endif %} {{ domain.name }} - {{ domain.users | count }} / {{ '∞' if domain.max_users == -1 else domain.max_users }} - {{ domain.aliases | count }} / {{ '∞' if domain.max_aliases == -1 else domain.max_aliases }} + {{ domain.users | count }} / {{ '∞' if domain.max_users == -1 else domain.max_users }} + {{ domain.aliases | count }} / {{ '∞' if domain.max_aliases == -1 else domain.max_aliases }} {{ domain.comment or '' }} - {{ domain.created_at | format_date }} - {{ domain.updated_at | format_date }} + {{ domain.created_at | format_date }} + {{ domain.updated_at | format_date }} {%- endfor %} diff --git a/core/admin/mailu/ui/templates/fetch/list.html b/core/admin/mailu/ui/templates/fetch/list.html index a504b7a2..9f0570fd 100644 --- a/core/admin/mailu/ui/templates/fetch/list.html +++ b/core/admin/mailu/ui/templates/fetch/list.html @@ -16,7 +16,7 @@ {%- call macros.table() %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Endpoint{% endtrans %} {% trans %}Username{% endtrans %} {% trans %}Keep emails{% endtrans %} @@ -38,8 +38,8 @@ {% if fetch.keep %}{% trans %}yes{% endtrans %}{% else %}{% trans %}no{% endtrans %}{% endif %} {{ fetch.last_check | format_datetime or '-' }} {{ fetch.error or '-' }} - {{ fetch.created_at | format_date }} - {{ fetch.updated_at | format_date }} + {{ fetch.created_at | format_date }} + {{ fetch.updated_at | format_date }} {%- endfor %} diff --git a/core/admin/mailu/ui/templates/macros.html b/core/admin/mailu/ui/templates/macros.html index 46a76991..90084246 100644 --- a/core/admin/mailu/ui/templates/macros.html +++ b/core/admin/mailu/ui/templates/macros.html @@ -86,7 +86,7 @@ {%- endmacro %} -{%- macro table(title=None, theme="primary", datatable=True) %} +{%- macro table(title=None, theme="primary", datatable=True, order=None) %}
@@ -96,7 +96,7 @@
{%- endif %}
- +
{{- caller() }}
diff --git a/core/admin/mailu/ui/templates/relay/list.html b/core/admin/mailu/ui/templates/relay/list.html index 1a23ee12..e1184769 100644 --- a/core/admin/mailu/ui/templates/relay/list.html +++ b/core/admin/mailu/ui/templates/relay/list.html @@ -11,10 +11,10 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Domain name{% endtrans %} {% trans %}Remote host{% endtrans %} {% trans %}Comment{% endtrans %} @@ -32,8 +32,8 @@ {{ relay.name }} {{ relay.smtp or '-' }} {{ relay.comment or '' }} - {{ relay.created_at | format_date }} - {{ relay.updated_at | format_date }} + {{ relay.created_at | format_date }} + {{ relay.updated_at | format_date }} {%- endfor %} diff --git a/core/admin/mailu/ui/templates/token/list.html b/core/admin/mailu/ui/templates/token/list.html index d7c48737..21cd3df7 100644 --- a/core/admin/mailu/ui/templates/token/list.html +++ b/core/admin/mailu/ui/templates/token/list.html @@ -16,7 +16,7 @@ {%- call macros.table() %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Comment{% endtrans %} {% trans %}Authorized IP{% endtrans %} {% trans %}Created{% endtrans %} @@ -31,8 +31,8 @@ {{ token.comment }} {{ token.ip or "any" }} - {{ token.created_at | format_date }} - {{ token.updated_at | format_date }} + {{ token.created_at | format_date }} + {{ token.updated_at | format_date }} {%- endfor %} diff --git a/core/admin/mailu/ui/templates/user/list.html b/core/admin/mailu/ui/templates/user/list.html index 7faddab5..96e917cc 100644 --- a/core/admin/mailu/ui/templates/user/list.html +++ b/core/admin/mailu/ui/templates/user/list.html @@ -16,8 +16,8 @@ {%- call macros.table() %} - {% trans %}Actions{% endtrans %} - {% trans %}User settings{% endtrans %} + {% trans %}Actions{% endtrans %} + {% trans %}User settings{% endtrans %} {% trans %}Email{% endtrans %} {% trans %}Features{% endtrans %} {% trans %}Quota{% endtrans %} @@ -39,14 +39,14 @@   {{ user }} - + {% if user.enable_imap %}imap{% endif %} {% if user.enable_pop %}pop3{% endif %} - {{ user.quota_bytes_used | filesizeformat }} / {{ (user.quota_bytes | filesizeformat) if user.quota_bytes else '∞' }} + {{ user.quota_bytes_used | filesizeformat }} / {{ (user.quota_bytes | filesizeformat) if user.quota_bytes else '∞' }} {{ user.comment or '-' }} - {{ user.created_at | format_date }} - {{ user.updated_at | format_date }} + {{ user.created_at | format_date }} + {{ user.updated_at | format_date }} {%- endfor %} From 4776094ea7058273e524fd8acd00e2c400fe08d6 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 3 Nov 2022 14:04:43 +0100 Subject: [PATCH 2/6] Configure datatables on missing tables, add sign in button to sso page. --- core/admin/mailu/sso/templates/sidebar_sso.html | 6 ++++++ core/admin/mailu/ui/templates/client.html | 5 ++++- core/admin/mailu/ui/templates/domain/list.html | 2 ++ core/admin/mailu/ui/templates/fetch/list.html | 2 +- core/admin/mailu/ui/templates/manager/list.html | 4 ++-- core/admin/mailu/ui/templates/user/signup_domain.html | 6 +++--- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/core/admin/mailu/sso/templates/sidebar_sso.html b/core/admin/mailu/sso/templates/sidebar_sso.html index 86db3333..0f75a1de 100644 --- a/core/admin/mailu/sso/templates/sidebar_sso.html +++ b/core/admin/mailu/sso/templates/sidebar_sso.html @@ -36,6 +36,12 @@ {%- endif %} + {#- User self-registration is only available when - Admin is available diff --git a/core/admin/mailu/ui/templates/client.html b/core/admin/mailu/ui/templates/client.html index bf0ba64e..fddbe0d2 100644 --- a/core/admin/mailu/ui/templates/client.html +++ b/core/admin/mailu/ui/templates/client.html @@ -9,7 +9,6 @@ {%- endblock %} {%- block content %} -
If you use an Apple device, click here to autoconfigure it.
{%- call macros.table(title=_("Incoming mail"), datatable=False) %} @@ -59,4 +58,8 @@ {%- endcall %} +
+ {% trans %}If you use an Apple device,{% endtrans %} + {% trans %}click here to autoconfigure it.{% endtrans %} +
{%- endblock %} diff --git a/core/admin/mailu/ui/templates/domain/list.html b/core/admin/mailu/ui/templates/domain/list.html index a6cefe9e..4363e2b8 100644 --- a/core/admin/mailu/ui/templates/domain/list.html +++ b/core/admin/mailu/ui/templates/domain/list.html @@ -20,6 +20,7 @@ {% trans %}Mailbox count{% endtrans %} {% trans %}Alias count{% endtrans %} {% trans %}Comment{% endtrans %} + {% trans %}Enable sign-up{% endtrans %} {% trans %}Created{% endtrans %} {% trans %}Last edit{% endtrans %} @@ -46,6 +47,7 @@ {{ domain.users | count }} / {{ '∞' if domain.max_users == -1 else domain.max_users }} {{ domain.aliases | count }} / {{ '∞' if domain.max_aliases == -1 else domain.max_aliases }} {{ domain.comment or '' }} + {% if domain.signup_enabled %}{% trans %}yes{% endtrans %}{% else %}{% trans %}no{% endtrans %}{% endif %} {{ domain.created_at | format_date }} {{ domain.updated_at | format_date }} diff --git a/core/admin/mailu/ui/templates/fetch/list.html b/core/admin/mailu/ui/templates/fetch/list.html index 9f0570fd..05a2f095 100644 --- a/core/admin/mailu/ui/templates/fetch/list.html +++ b/core/admin/mailu/ui/templates/fetch/list.html @@ -35,7 +35,7 @@ {{ fetch.protocol }}{{ 's' if fetch.tls else '' }}://{{ fetch.host }}:{{ fetch.port }} {{ fetch.username }} - {% if fetch.keep %}{% trans %}yes{% endtrans %}{% else %}{% trans %}no{% endtrans %}{% endif %} + {% if fetch.keep %}{% trans %}yes{% endtrans %}{% else %}{% trans %}no{% endtrans %}{% endif %} {{ fetch.last_check | format_datetime or '-' }} {{ fetch.error or '-' }} {{ fetch.created_at | format_date }} diff --git a/core/admin/mailu/ui/templates/manager/list.html b/core/admin/mailu/ui/templates/manager/list.html index 706594c4..95dc9f4a 100644 --- a/core/admin/mailu/ui/templates/manager/list.html +++ b/core/admin/mailu/ui/templates/manager/list.html @@ -13,10 +13,10 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[2,"asc"]]') %} - {% trans %}Actions{% endtrans %} + {% trans %}Actions{% endtrans %} {% trans %}Email{% endtrans %} diff --git a/core/admin/mailu/ui/templates/user/signup_domain.html b/core/admin/mailu/ui/templates/user/signup_domain.html index a7db4c97..433d1b3f 100644 --- a/core/admin/mailu/ui/templates/user/signup_domain.html +++ b/core/admin/mailu/ui/templates/user/signup_domain.html @@ -9,7 +9,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Domain{% endtrans %} {% trans %}Available slots{% endtrans %} @@ -18,8 +18,8 @@ {%- for domain_name, domain in available_domains.items() %} {{ domain_name }} - {{ '∞' if domain.max_users == -1 else domain.max_users - (domain.users | count)}} - {{ domain.max_quota_bytes or config['DEFAULT_QUOTA'] | filesizeformat }} + {{ '∞' if domain.max_users == -1 else domain.max_users - (domain.users | count)}} + {{ domain.max_quota_bytes or config['DEFAULT_QUOTA'] | filesizeformat }} {%- endfor %} {%- endcall %} From 2778641e7803f7f8aaa8d17a42a2f5ae73011c1d Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 3 Nov 2022 14:43:45 +0100 Subject: [PATCH 3/6] Fix screen reader title of language selector --- core/admin/mailu/sso/templates/base_sso.html | 2 +- core/admin/mailu/ui/templates/base.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/admin/mailu/sso/templates/base_sso.html b/core/admin/mailu/sso/templates/base_sso.html index 9dfb25a5..259e5841 100644 --- a/core/admin/mailu/sso/templates/base_sso.html +++ b/core/admin/mailu/sso/templates/base_sso.html @@ -34,7 +34,7 @@