@@ -289,44 +324,38 @@
Mailinglists will forward all emails to the assigned mailboxes.
+
+
+
+
+
+
+
+ | Name |
+ Mailboxes |
+ Action |
+
+
+
+
+ |
+ {{ list.name }}
+ |
+
+ {{ list.members.join(', ') }}
+ |
+
+
+
+ |
+
+
+
+
-
-
diff --git a/dashboard/src/views/email.js b/dashboard/src/views/email.js
index 404a18036..f1ace6814 100644
--- a/dashboard/src/views/email.js
+++ b/dashboard/src/views/email.js
@@ -67,26 +67,36 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
add: {
busy: false,
- error: '',
+ error: null,
name: '',
members: [],
+ reset: function () {
+ $scope.mailinglists.add.busy = false;
+ $scope.mailinglists.add.error = null;
+ $scope.mailinglists.add.name = '';
+ $scope.mailinglists.add.members = [];
+ },
+
+ show: function () {
+ $scope.mailinglists.add.reset();
+ $('#mailinglistAddModal').modal('show');
+ },
+
submit: function () {
$scope.mailinglists.add.busy = true;
Client.addMailingList($scope.selectedDomain.domain, $scope.mailinglists.add.name, $scope.mailinglists.add.members, function (error) {
- $scope.mailinglists.add.busy = false;
-
if (error) {
- $scope.mailinglists.add.error = error.message;
+ $scope.mailinglists.add.busy = false;
+ $scope.mailinglists.add.error = error;
return;
}
- $scope.mailinglists.add.error = '';
- $scope.mailinglists.add.name = '';
- $scope.mailinglists.add.members = [];
-
+ $scope.mailinglists.add.reset();
$scope.mailinglists.refresh();
+
+ $('#mailinglistAddModal').modal('hide');
});
}
},
@@ -570,7 +580,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
});
// setup all the dialog focus handling
- ['testEmailModal', 'mailboxAddModal', 'mailboxEditModal', 'mailinglistEditModal'].forEach(function (id) {
+ ['testEmailModal', 'mailboxAddModal', 'mailboxEditModal', 'mailinglistEditModal', 'mailinglistAddModal'].forEach(function (id) {
$('#' + id).on('shown.bs.modal', function () {
$(this).find("[autofocus]:first").focus();
});