Various fixes to mailbox sharing ui
This commit is contained in:
+18
-3
@@ -215,7 +215,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content content-large">
|
||||
<div class="content">
|
||||
<div class="text-left">
|
||||
<h1>
|
||||
{{ 'emails.title' | tr }}
|
||||
@@ -232,7 +232,7 @@
|
||||
<h3>{{ 'emails.domains.title' | tr }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="card card-large" style="margin-bottom: 15px;">
|
||||
<div class="card" style="margin-bottom: 15px;">
|
||||
<div class="row ng-hide" ng-hide="ready">
|
||||
<div class="col-lg-12 text-center">
|
||||
<h2><i class="fa fa-circle-notch fa-spin"></i></h2>
|
||||
@@ -278,11 +278,26 @@
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="text-left" ng-show="user.isAtLeastOwner">
|
||||
<h3>{{ 'emails.mailboxSharing.title' | tr }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="card" ng-show="user.isAtLeastOwner" style="margin-bottom: 15px;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>{{ 'emails.mailboxSharing.description' | tr }}</p>
|
||||
<p ng-show="mailboxSharing.enabled !== null && mailboxSharing.enabled">{{ 'emails.mailboxSharing.enabled' | tr }}</p>
|
||||
<p ng-show="mailboxSharing.enabled !== null && !mailboxSharing.enabled">{{ 'emails.mailboxSharing.disabled' | tr }}</p>
|
||||
<button ng-class="mailboxSharing.enabled ? 'btn btn-danger pull-right' : 'btn btn-primary pull-right'" ng-click="mailboxSharing.submit()" ng-disabled="mailboxSharing.enable === mailboxSharing.enabled"><i class="fa fa-circle-notch fa-spin" ng-show="mailboxSharing.busy"></i> {{ mailboxSharing.enabled ? ('main.disableAction' | tr) : ('main.enableAction' | tr) }} </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-left" ng-show="user.isAtLeastOwner">
|
||||
<h3>{{ 'emails.settings.title' | tr }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="card card-large" ng-show="user.isAtLeastOwner" style="margin-bottom: 15px;">
|
||||
<div class="card" ng-show="user.isAtLeastOwner" style="margin-bottom: 15px;">
|
||||
<p ng-bind-html=" 'emails.settings.info' | tr "></p>
|
||||
|
||||
<div class="row">
|
||||
|
||||
+8
-23
@@ -157,9 +157,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
$scope.mailboxSharing = {
|
||||
busy: false,
|
||||
error: null,
|
||||
size: 0,
|
||||
enable: false,
|
||||
enabled: false,
|
||||
enabled: null, // null means we have not refreshed yet
|
||||
|
||||
refresh: function () {
|
||||
Client.getMailboxSharing(function (error, enabled) {
|
||||
@@ -169,30 +167,17 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
});
|
||||
},
|
||||
|
||||
show: function() {
|
||||
$scope.mailboxSharing.busy = false;
|
||||
$scope.mailboxSharing.error = null;
|
||||
$scope.mailboxSharing.enable = $scope.mailboxSharing.enabled;
|
||||
|
||||
$scope.mailboxSharingChangeForm.$setUntouched();
|
||||
$scope.mailboxSharingChangeForm.$setPristine();
|
||||
|
||||
$('#mailboxSharingChangeModal').modal('show');
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.mailboxSharing.busy = true;
|
||||
|
||||
Client.setMailboxSharing($scope.mailboxSharing.enable, function (error) {
|
||||
$scope.mailboxSharing.busy = false;
|
||||
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.mailboxSharing.enabled = $scope.mailboxSharing.enable;
|
||||
|
||||
$('#mailboxSharingChangeModal').modal('hide');
|
||||
Client.setMailboxSharing(!$scope.mailboxSharing.enabled, function (error) {
|
||||
// give sometime for mail server to restart
|
||||
$timeout(function () {
|
||||
$scope.mailboxSharing.busy = false;
|
||||
if (error) return console.error(error);
|
||||
$scope.mailboxSharing.enabled = !$scope.mailboxSharing.enabled;
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user