From 0846467ffb4dc871f8bd1bb00795a902b49b3cb8 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 10 Mar 2023 17:10:05 +0100 Subject: [PATCH] [Web] organize user landing --- data/web/css/build/014-mailcow.css | 1 + data/web/js/site/user.js | 30 +- data/web/templates/domainadmin.twig | 141 ++++---- data/web/templates/user.twig | 1 - data/web/templates/user/Spamfilter.twig | 8 +- data/web/templates/user/tab-user-auth.twig | 310 ++++++++++-------- .../web/templates/user/tab-user-settings.twig | 24 +- 7 files changed, 283 insertions(+), 232 deletions(-) diff --git a/data/web/css/build/014-mailcow.css b/data/web/css/build/014-mailcow.css index 885018e1..8e161bb0 100644 --- a/data/web/css/build/014-mailcow.css +++ b/data/web/css/build/014-mailcow.css @@ -385,6 +385,7 @@ button[aria-expanded='true'] > .caret { background-color: #f0f0f0; } .btn.btn-outline-secondary { + color: #000000 !important; border-color: #cfcfcf !important; } .btn-check:checked+.btn-outline-secondary, .btn-check:active+.btn-outline-secondary, .btn-outline-secondary:active, .btn-outline-secondary.active, .btn-outline-secondary.dropdown-toggle.show { diff --git a/data/web/js/site/user.js b/data/web/js/site/user.js index b2139829..cf79b277 100644 --- a/data/web/js/site/user.js +++ b/data/web/js/site/user.js @@ -77,11 +77,11 @@ jQuery(function($){ acl_data = JSON.parse(acl); $('.clear-last-logins').on('click', function () {if (confirm(lang.delete_ays)) {last_logins('reset');}}) - $(".login-history").on('click', function(e) {e.preventDefault(); last_logins('get', $(this).data('days'));$(this).addClass('active').siblings().removeClass('active');}); + $(".login-history").on('click', function(e) {e.preventDefault(); last_logins('get', $(this).data('days'));$(this).parent().find('li a').removeClass('active');$(this).children(':first-child').addClass('active')}); function last_logins(action, days = 7) { if (action == 'get') { - $('.last-login').html('' + lang.waiting); + $('#spinner-last-login').removeClass('d-none'); $.ajax({ dataType: 'json', url: '/api/v1/get/last-login/' + encodeURIComponent(mailcow_cc_username) + '/' + days, @@ -90,26 +90,38 @@ jQuery(function($){ console.log('error reading last logins'); }, success: function (data) { - $('.last-login').html(); + $('.last-ui-login').html(''); + $('.last-sasl-login').html(''); if (data.ui.time) { - $('.last-login').html(' ' + lang.last_ui_login + ': ' + unix_time_format(data.ui.time)); + $('.last-ui-login').html(' ' + lang.last_ui_login + ': ' + unix_time_format(data.ui.time)); } else { - $('.last-login').text(lang.no_last_login); + $('.last-ui-login').text(lang.no_last_login); } if (data.sasl) { - $('.last-login').append(''); } + + $('#spinner-last-login').addClass('d-none'); } }) } else if (action == 'reset') { diff --git a/data/web/templates/domainadmin.twig b/data/web/templates/domainadmin.twig index 070bf00c..9cfd2559 100644 --- a/data/web/templates/domainadmin.twig +++ b/data/web/templates/domainadmin.twig @@ -1,80 +1,83 @@ {% extends 'base.twig' %} {% block content %} -

{{ lang.user.user_settings }}

-
-
{{ lang.user.user_settings }}
-
-
-
-

[{{ lang.user.change_password }}]

- - {{ lang.user.clear_recent_successful_connections }} -
-
-
+
+
+
+
{{ lang.user.user_settings }}
+
+
+
+

[{{ lang.user.change_password }}]

+ + {{ lang.user.clear_recent_successful_connections }} +
+
+
- {# TFA #} -
-
{{ lang.tfa.tfa }}
-
-

{{ tfa_data.pretty }}

- {% include 'tfa_keys.twig' %} -
-
-
-
-
{{ lang.tfa.set_tfa }}
-
- -
-
+ {# TFA #} +
+
{{ lang.tfa.tfa }}
+
+

{{ tfa_data.pretty }}

+ {% include 'tfa_keys.twig' %} +
+
+
+
+
{{ lang.tfa.set_tfa }}
+
+ +
+
-
- {# FIDO2 #} -
-
-

{{ lang.fido2.fido2_auth }}

-
-
-
-
{{ lang.fido2.known_ids }}:
-
-
- - - - - - {% include 'fido2.twig' %} -
ID{{ lang.admin.action }}
-
-
-
-
-
-
-
- - - +
+ {# FIDO2 #} +
+
+

{{ lang.fido2.fido2_auth }}

+
+
+
+
{{ lang.fido2.known_ids }}:
+
+
+ + + + + + {% include 'fido2.twig' %} +
ID{{ lang.admin.action }}
+
+
-
-
-
-
{{ lang.fido2.register_status }}:
-
-
-
+
+
+
+ + + +
+
+
+
+
+
{{ lang.fido2.register_status }}:
+
+
-
+
+
+
-
diff --git a/data/web/templates/user.twig b/data/web/templates/user.twig index 22cc00d0..39f9ad08 100644 --- a/data/web/templates/user.twig +++ b/data/web/templates/user.twig @@ -33,7 +33,6 @@
-
{% include 'user_domainadmin_common.twig' %}
{% endblock %} diff --git a/data/web/templates/user/Spamfilter.twig b/data/web/templates/user/Spamfilter.twig index 7a3baf32..3ad0f475 100644 --- a/data/web/templates/user/Spamfilter.twig +++ b/data/web/templates/user/Spamfilter.twig @@ -39,10 +39,10 @@

-
+

{{ lang.user.spamfilter_wl }}

{{ lang.user.spamfilter_wl_desc|raw }}

-
+
@@ -63,10 +63,10 @@
-
+

{{ lang.user.spamfilter_bl }}

{{ lang.user.spamfilter_bl_desc|raw }}

- +
diff --git a/data/web/templates/user/tab-user-auth.twig b/data/web/templates/user/tab-user-auth.twig index 646c7910..403f0db6 100644 --- a/data/web/templates/user/tab-user-auth.twig +++ b/data/web/templates/user/tab-user-auth.twig @@ -8,157 +8,193 @@
{% if mailboxdata.attributes.force_pw_update == '1' %} -
{{ lang.user.force_pw_update|raw }}
+
{{ lang.user.force_pw_update|raw }}
{% endif %} - {% if not skip_sogo %}
- -
- {% if dual_login and allow_admin_email_login == 'n' or mailboxdata.attributes.force_pw_update == '1' %} - - {% else %} - - {{ lang.user.open_webmail_sso }} - +
+ {% if not skip_sogo %} +
+
+ {% if dual_login and allow_admin_email_login == 'n' or mailboxdata.attributes.force_pw_update == '1' %} + + {% else %} + + {{ lang.user.open_webmail_sso }} + + {% endif %} +
+
{% endif %} -
-
-
-
-
-
-

{{ lang.user.direct_protocol_access|raw }}

- {% if mailboxdata.attributes.imap_access == 1 %}
IMAP
{% else %}
IMAP
{% endif %} - {% if mailboxdata.attributes.smtp_access == 1 %}
SMTP
{% else %}
SMTP
{% endif %} - {% if mailboxdata.attributes.sieve_access == 1 %}
Sieve
{% else %}
Sieve
{% endif %} - {% if mailboxdata.attributes.pop3_access == 1 %}
POP3
{% else %}
POP3
{% endif %} - {% if mailboxdata.attributes.sogo_access == 1 %}
SOGo
{% else %}
SOGo
{% endif %} -
-
-
- {% endif %} -
-
{{ lang.user.in_use }}:
-
-
+ + {{ lang.user.overview }} +
+
+
{{ mailboxdata.messages }} {{ lang.user.messages }}
+
{{ mailboxdata.quota_used|formatBytes(2) }} / {% if mailboxdata.quota == 0 %}∞{% else %}{{ mailboxdata.quota|formatBytes(2) }}{% endif %}
+
+
{{ mailboxdata.percent_in_use }}%
-

{{ mailboxdata.quota_used|formatBytes(2) }} / {% if mailboxdata.quota == 0 %}∞{% else %}{{ mailboxdata.quota|formatBytes(2) }}{% endif %}
{{ mailboxdata.messages }} {{ lang.user.messages }}

+ +
+
+ {{ lang.user.protocols }}: +
+
+ +
+ {% if mailboxdata.attributes.imap_access == 1 %}
IMAP
{% else %}
IMAP
{% endif %} + {% if mailboxdata.attributes.smtp_access == 1 %}
SMTP
{% else %}
SMTP
{% endif %} + {% if mailboxdata.attributes.sieve_access == 1 %}
Sieve
{% else %}
Sieve
{% endif %} + {% if mailboxdata.attributes.pop3_access == 1 %}
POP3
{% else %}
POP3
{% endif %} + {% if not skip_sogo %}{% if mailboxdata.attributes.sogo_access == 1 %}
SOGo
{% else %}
SOGo
{% endif %}{% endif %} +
+
+
+
+
+ {{ lang.user.apple_connection_profile }}: +
+
+ + {% if not skip_sogo %} + + {% endif %} +
+
+
+
+ {{ lang.user.apple_connection_profile }}
{{ lang.user.with_app_password }}:
+
+
+ + {% if not skip_sogo %} + + {% endif %} +
+
+ + + {# TFA #} + {{ lang.user.authentication }}
-

{{ lang.user.change_password }}

-
-
-
- {# TFA #} -
-
{{ lang.tfa.tfa }}:
-
-

{{ tfa_data.pretty }}

- {% include 'tfa_keys.twig' %} -
-
-
-
-
{{ lang.tfa.set_tfa }}:
-
- -
-
-
- {# FIDO2 #} -
-
-

{{ lang.fido2.fido2_auth }}

-
-
-
-
- {{ lang.fido2.known_ids }}: -
-
-
- - - - - - {% include 'fido2.twig' %} -
ID{{ lang.admin.action }}
+ +
+
+ {{ lang.tfa.tfa }}: +
+
+ {{ tfa_data.pretty }} + {% include 'tfa_keys.twig' %} +
+
+
+
+ {{ lang.tfa.set_tfa }}: +
+
+ + +
+
+ {# FIDO2 #} +
+
+

{{ lang.fido2.fido2_auth }}

+
+
+
+
+ {{ lang.fido2.known_ids }}: +
+
+
+ + + + + + {% include 'fido2.twig' %} +
ID{{ lang.admin.action }}
+
+
+
+
+
+
+
+ + + +
+

-
-
-
-
-
- - - +
+
{{ lang.fido2.register_status }}:
+
+
-
+
+
-
-
-
-
{{ lang.fido2.register_status }}:
-
-
-
-
-
-
-
-
-
{{ lang.user.apple_connection_profile }}:
-
-

{{ lang.user.email }} IMAP, SMTP

-

{{ lang.user.apple_connection_profile_mailonly }}

- {% if not skip_sogo %} -

{{ lang.user.email_and_dav }} IMAP, SMTP, Cal/CardDAV

-

{{ lang.user.apple_connection_profile_complete }}

- {% endif %} -
-
-
-
{{ lang.user.apple_connection_profile }}
{{ lang.user.with_app_password }}:
-
-

{{ lang.user.email }} IMAP, SMTP

-

{{ lang.user.apple_connection_profile_mailonly }} {{ lang.user.apple_connection_profile_with_app_password }}

- {% if not skip_sogo %} -

{{ lang.user.email_and_dav }} IMAP, SMTP, Cal/CardDAV

-

{{ lang.user.apple_connection_profile_complete }} {{ lang.user.apple_connection_profile_with_app_password }}

- {% endif %} -
-
-
-
-
-

[{{ lang.user.client_configuration }}]

-

[{{ lang.user.show_sieve_filters }}]

+
+ + {{ lang.user.recent_successful_connections }} +
+ Loading... +
+

- -
diff --git a/data/web/templates/user/tab-user-settings.twig b/data/web/templates/user/tab-user-settings.twig index a1426fa2..005a0555 100644 --- a/data/web/templates/user/tab-user-settings.twig +++ b/data/web/templates/user/tab-user-settings.twig @@ -12,19 +12,19 @@
{{ lang.user.tag_handling }}:
- - -
- -
- - - -
- - -