diff --git a/management/templates/aliases.html b/management/templates/aliases.html index 50f538b2..f8fb3c17 100644 --- a/management/templates/aliases.html +++ b/management/templates/aliases.html @@ -26,7 +26,7 @@
- +
@@ -36,7 +36,7 @@
- +
@@ -45,7 +45,7 @@
- +
- +
-
- +
+ + +
-
- +
@@ -182,7 +179,33 @@ function show_aliases() { } }) $('#alias_type_buttons button[data-mode="regular"]').click(); // init - }) + + // Service buttons + $('#alias_service_buttons button').off('click').click(function() { + if ($(this).hasClass('active')) { + $(this).removeClass('active'); + $(this).addClass('btn-default'); + $(this).removeClass('btn-success'); + $('#alias_service_info .www').addClass('hidden'); + $('#alias_service_info .dns').addClass('hidden'); + if ($(this).attr('data-mode') == "dns") { + $('#alias_service_info').slideDown(); + $('#addalias-form .dns').removeClass('hidden'); + } else if ($(this).attr('data-mode') == "www") { + $('#alias_service_info').slideDown(); + $('#addalias-form .www').removeClass('hidden'); + } + } else { + $(this).addClass('active'); + $(this).removeClass('btn-default'); + $(this).addClass('btn-success'); + $('#alias_service_info').slideUp(); + $('#addalias-form .www').addClass('hidden'); + $('#addalias-form .dns').addClass('hidden'); + } + return false; + }); + }); } var is_alias_add_update = false; @@ -191,8 +214,8 @@ function do_add_alias() { var form_address = $("#addaliasAddress").val(); var form_forwardsto = $("#addaliasForwardsTo").val(); var form_senders = ($('#addaliasForwardsToAdvanced').prop('checked') ? $("#addaliasSenders").val() : ''); - var form_dns = $('#addaliasDnsHandling').prop('checked'); - var form_web = $('#addaliasWebHandling').prop('checked'); + var form_dns = $('#addaliasDnsHandling').hasClass('active'); + var form_web = $('#addaliasWebHandling').hasClass('active'); if ($('#addaliasForwardsToAdvanced').prop('checked') && !/\S/.exec($("#addaliasSenders").val())) { show_modal_error(title, "You did not enter any permitted senders."); return false; @@ -225,13 +248,17 @@ function aliases_reset_form() { $("#addaliasAddress").val('') $("#addaliasForwardsTo").val('') $("#addaliasSenders").val('') - $('#addaliasDnsHandling').prop('disabled', false); - $('#addaliasWebHandling').prop('disabled', false); $('#alias-cancel').addClass('hidden'); $('#add-alias-button').text('Add Alias'); is_alias_add_update = false; + + $('#addaliasDnsHandling').prop('disabled', false).addClass('btn-success'); + $('#addaliasWebHandling').prop('disabled', false).addClass('btn-success'); + } + + function aliases_edit(elem) { var address = $(elem).parents('tr').attr('data-address'); var receiverdivs = $(elem).parents('tr').find('.forwardsTo div'); diff --git a/management/templates/users.html b/management/templates/users.html index 6e07673a..8c57c20f 100644 --- a/management/templates/users.html +++ b/management/templates/users.html @@ -29,24 +29,20 @@
- -
-
- -
-
- +
+
+ + +
+
  • Passwords must be at least four characters and may not contain spaces. For best results, generate a random password.
  • Use aliases to create email addresses that forward to existing accounts.
  • @@ -154,14 +150,41 @@ function show_users() { } } }) + + // Service buttons + $('#user_service_buttons button').off('click').click(function() { + if ($(this).hasClass('active')) { + $(this).removeClass('active'); + $(this).addClass('btn-default'); + $(this).removeClass('btn-success'); + $('#user_service_info .www').addClass('hidden'); + $('#user_service_info .dns').addClass('hidden'); + if ($(this).attr('data-mode') == "dns") { + $('#user_service_info').slideDown(); + $('#user_service_info .dns').removeClass('hidden'); + } else if ($(this).attr('data-mode') == "www") { + $('#user_service_info').slideDown(); + $('#user_service_info .www').removeClass('hidden'); + } + } else { + $(this).addClass('active'); + $(this).removeClass('btn-default'); + $(this).addClass('btn-success'); + $('#user_service_info').slideUp(); + $('#user_service_info .www').addClass('hidden'); + $('#user_service_info .dns').addClass('hidden'); + } + return false; + }); + } function do_add_user() { var email = $("#adduserEmail").val(); var pw = $("#adduserPassword").val(); var privs = $("#adduserPrivs").val(); - var form_dns = $('#adduserDnsHandling').prop('checked'); - var form_web = $('#adduserWebHandling').prop('checked'); + var form_dns = $('#adduserDnsHandling').hasClass('active'); + var form_web = $('#adduserWebHandling').hasClass('active'); api( "/mail/users/add", "POST",