diff --git a/core/admin/assets/assets/app.css b/core/admin/assets/assets/app.css index 84644900..a25a4cfb 100644 --- a/core/admin/assets/assets/app.css +++ b/core/admin/assets/assets/app.css @@ -57,3 +57,9 @@ fieldset:disabled .form-control:disabled { .input-group-text { margin-right: 1em; } + +/* version string */ +.mailu-version { + font-size: 60%; + line-height: 0; +} diff --git a/core/admin/assets/assets/app.js b/core/admin/assets/assets/app.js index 661e0242..33f63433 100644 --- a/core/admin/assets/assets/app.js +++ b/core/admin/assets/assets/app.js @@ -86,9 +86,12 @@ $('document').ready(function() { if (value_element.length) { value_element = $(value_element[0]); var infinity = $(this).data('infinity'); - var step = $(this).attr('step'); + var unit = $(this).data('unit'); + if (typeof unit === 'undefined' || unit === false) { + unit=1; + } $(this).on('input', function() { - var num = (infinity && this.value == 0) ? '∞' : (this.value/step).toFixed(2); + var num = (infinity && this.value == 0) ? '∞' : (this.value/unit).toFixed(2); if (num.endsWith('.00')) num = num.substr(0, num.length - 3); value_element.text(num); }).trigger('input'); diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py index 004fe504..11d79643 100644 --- a/core/admin/mailu/configuration.py +++ b/core/admin/mailu/configuration.py @@ -18,6 +18,7 @@ DEFAULT_CONFIG = { 'TEMPLATES_AUTO_RELOAD': True, 'MEMORY_SESSIONS': False, 'FETCHMAIL_ENABLED': True, + 'MAILU_VERSION': 'unknown', # Database settings 'DB_FLAVOR': None, 'DB_USER': 'mailu', @@ -157,6 +158,10 @@ class ConfigManager: self.config['HOSTNAME'] = hostnames[0] self.config['DEFAULT_SPAM_THRESHOLD'] = int(self.config['DEFAULT_SPAM_THRESHOLD']) self.config['PROXY_AUTH_WHITELIST'] = set(ipaddress.ip_network(cidr, False) for cidr in (cidr.strip() for cidr in self.config['PROXY_AUTH_WHITELIST'].split(',')) if cidr) + try: + self.config['MAILU_VERSION'] = open('/version', 'r').read() + except FileNotFoundError: + pass # update the app config app.config.update(self.config) diff --git a/core/admin/mailu/ui/templates/admin/list.html b/core/admin/mailu/ui/templates/admin/list.html index e50c0ee6..4fb9e32d 100644 --- a/core/admin/mailu/ui/templates/admin/list.html +++ b/core/admin/mailu/ui/templates/admin/list.html @@ -11,7 +11,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Actions{% endtrans %} @@ -22,6 +22,7 @@ {%- for admin in admins %} +   {{ admin }} diff --git a/core/admin/mailu/ui/templates/alias/list.html b/core/admin/mailu/ui/templates/alias/list.html index 833e44c1..63dcb306 100644 --- a/core/admin/mailu/ui/templates/alias/list.html +++ b/core/admin/mailu/ui/templates/alias/list.html @@ -13,7 +13,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Actions{% endtrans %} diff --git a/core/admin/mailu/ui/templates/alternative/list.html b/core/admin/mailu/ui/templates/alternative/list.html index 97482ac3..4b8397cf 100644 --- a/core/admin/mailu/ui/templates/alternative/list.html +++ b/core/admin/mailu/ui/templates/alternative/list.html @@ -13,7 +13,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Actions{% endtrans %} diff --git a/core/admin/mailu/ui/templates/base.html b/core/admin/mailu/ui/templates/base.html index 2ab21492..6484b355 100644 --- a/core/admin/mailu/ui/templates/base.html +++ b/core/admin/mailu/ui/templates/base.html @@ -78,6 +78,11 @@ fork on Github +
+ + {{ config["MAILU_VERSION"] }} + +
diff --git a/core/admin/mailu/ui/templates/domain/create.html b/core/admin/mailu/ui/templates/domain/create.html index f0d5308d..4eb7bfc8 100644 --- a/core/admin/mailu/ui/templates/domain/create.html +++ b/core/admin/mailu/ui/templates/domain/create.html @@ -10,7 +10,7 @@ {{ form.hidden_tag() }} {{ macros.form_field(form.name) }} {{ macros.form_fields((form.max_users, form.max_aliases)) }} - {{ macros.form_field(form.max_quota_bytes, step=50*10**6, max=50*10**9, data_infinity="true", + {{ macros.form_field(form.max_quota_bytes, step=50*10**6, max=50*10**9, data_infinity="true", data_unit=10**9, prepend=' GB') }} {{ macros.form_field(form.signup_enabled) }} {{ macros.form_field(form.comment) }} diff --git a/core/admin/mailu/ui/templates/domain/list.html b/core/admin/mailu/ui/templates/domain/list.html index 4889bc8d..c4b4cd51 100644 --- a/core/admin/mailu/ui/templates/domain/list.html +++ b/core/admin/mailu/ui/templates/domain/list.html @@ -19,6 +19,7 @@ {% trans %}Domain name{% endtrans %} {% trans %}Mailbox count{% endtrans %} {% trans %}Alias count{% endtrans %} + {% trans %}Quota{% endtrans %} {% trans %}Comment{% endtrans %} {% trans %}Enable sign-up{% endtrans %} {% trans %}Created{% endtrans %} @@ -46,6 +47,7 @@ {{ 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.max_quota_bytes | filesizeformat) if domain.max_quota_bytes else '∞' }} {{ domain.comment or '' }} {% if domain.signup_enabled %}{% trans %}yes{% endtrans %}{% else %}{% trans %}no{% endtrans %}{% endif %} {{ domain.created_at | format_date }} diff --git a/core/admin/mailu/ui/templates/fetch/list.html b/core/admin/mailu/ui/templates/fetch/list.html index 74d3a02f..c021096e 100644 --- a/core/admin/mailu/ui/templates/fetch/list.html +++ b/core/admin/mailu/ui/templates/fetch/list.html @@ -13,7 +13,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Actions{% endtrans %} diff --git a/core/admin/mailu/ui/templates/manager/list.html b/core/admin/mailu/ui/templates/manager/list.html index 95dc9f4a..6ec0c8e9 100644 --- a/core/admin/mailu/ui/templates/manager/list.html +++ b/core/admin/mailu/ui/templates/manager/list.html @@ -13,7 +13,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table(order='[[2,"asc"]]') %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Actions{% endtrans %} @@ -24,6 +24,7 @@ {%- for manager in domain.managers %} +   {{ manager }} diff --git a/core/admin/mailu/ui/templates/token/list.html b/core/admin/mailu/ui/templates/token/list.html index a6eee9c3..1e61cf6b 100644 --- a/core/admin/mailu/ui/templates/token/list.html +++ b/core/admin/mailu/ui/templates/token/list.html @@ -13,7 +13,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[1,"asc"]]') %} {% trans %}Actions{% endtrans %} diff --git a/core/admin/mailu/ui/templates/user/create.html b/core/admin/mailu/ui/templates/user/create.html index 495e788b..dff78f64 100644 --- a/core/admin/mailu/ui/templates/user/create.html +++ b/core/admin/mailu/ui/templates/user/create.html @@ -21,7 +21,7 @@ {%- endcall %} {%- call macros.card(_("Features and quotas"), theme="success") %} - {{ macros.form_field(form.quota_bytes, step=50*10**6, max=(max_quota_bytes or domain.max_quota_bytes or 50*10**9), data_infinity="true", + {{ macros.form_field(form.quota_bytes, step=50*10**6, max=(max_quota_bytes or domain.max_quota_bytes or 50*10**9), data_infinity="true", data_unit=10**9, prepend=' GB') }} {{ macros.form_field(form.enable_imap) }} {{ macros.form_field(form.enable_pop) }} diff --git a/core/admin/mailu/ui/templates/user/list.html b/core/admin/mailu/ui/templates/user/list.html index 873c37e8..8d9f2873 100644 --- a/core/admin/mailu/ui/templates/user/list.html +++ b/core/admin/mailu/ui/templates/user/list.html @@ -13,7 +13,7 @@ {%- endblock %} {%- block content %} -{%- call macros.table() %} +{%- call macros.table(order='[[2,"asc"]]') %} {% trans %}Actions{% endtrans %} diff --git a/webmails/roundcube/login/skins/elastic/mailu.css b/webmails/roundcube/login/skins/elastic/mailu.css index a14d25b1..648609b3 100644 --- a/webmails/roundcube/login/skins/elastic/mailu.css +++ b/webmails/roundcube/login/skins/elastic/mailu.css @@ -9,3 +9,13 @@ color: #fff; background-color: #45555c; } +@media screen and (max-width: 480px) { + #taskmenu a.button-mailu { + background-position: 0px; + background-size: 40px 40px; + } + #taskmenu a.button-mailu.selected, #taskmenu a.button-mailu.selected:hover, #taskmenu a.button-mailu:hover { + color: #000; + background-color: #ececec; + } +}