diff --git a/dashboard/src/theme.scss b/dashboard/src/theme.scss
index 3def38540..3385d41f0 100644
--- a/dashboard/src/theme.scss
+++ b/dashboard/src/theme.scss
@@ -99,7 +99,6 @@ $table-border-color: transparent !default;
white-space: nowrap;
overflow: hidden;
max-width: 300px;
- width: 300px;
}
.dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover {
diff --git a/dashboard/src/views/email.html b/dashboard/src/views/email.html
index b9795fc25..3c4eaa378 100644
--- a/dashboard/src/views/email.html
+++ b/dashboard/src/views/email.html
@@ -193,29 +193,32 @@
- Manage mailboxes for users on this domain. Each user will get an email address of
username@{{ selectedDomain.domain }}
+ Enable mailboxes for users on this domain. Each user will get an email address of
username@{{ selectedDomain.domain }}
+
User
-
+ Aliases (Separate by comma)
Action
+
+
+
{{ user.username }}
-
-
+
+
-
- Disable
- Enable
+
+ Save
diff --git a/dashboard/src/views/email.js b/dashboard/src/views/email.js
index 7c93132f1..25cc15483 100644
--- a/dashboard/src/views/email.js
+++ b/dashboard/src/views/email.js
@@ -88,25 +88,18 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
$scope.mailboxes = {
users: [],
- enable: function (user) {
+ submit: function (user) {
user.busy = true;
- Client.enableUserMailbox($scope.selectedDomain.domain, user.id, function (error) {
+ var func = user.mailboxEnabled ? Client.enableUserMailbox : Client.disableUserMailbox;
+ func($scope.selectedDomain.domain, user.id, function (error) {
if (error) console.error(error);
- user.busy = false;
- user.mailboxEnabled = error ? false : true;
- });
- },
-
- disable: function (user) {
- user.busy = true;
-
- Client.disableUserMailbox($scope.selectedDomain.domain, user.id, function (error) {
- if (error) console.error(error);
+ // reset the dirty state
+ user.orig.mailboxEnabled = user.mailboxEnabled;
+ user.orig.aliases = user.aliases;
user.busy = false;
- user.mailboxEnabled = error ? true : false;
});
}
};
@@ -314,6 +307,12 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
var enabledUsers = mailboxes.map(function (m) { return m.name; });
$scope.mailboxes.users = $scope.users.filter(function (u) { return !!u.username; }).map(function (u) {
u.mailboxEnabled = (enabledUsers.indexOf(u.username) !== -1);
+ u.aliases = 'well, hello, there';
+
+ u.orig = {};
+ u.orig.mailboxEnabled = u.mailboxEnabled;
+ u.orig.aliases = u.aliases;
+
return u;
});
});