From 6218b363726c3340769a2eb125a88572b1908045 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 11 Jan 2022 16:49:39 +0100 Subject: [PATCH] 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 %}