Use modal to display success/error (#925)

environments/ppa-mbqj77/deployments/1
Clément Oudot 9 years ago
parent d86483f2c9
commit 7894406809
  1. 22
      lemonldap-ng-manager/site/static/js/notifications.js
  2. 2
      lemonldap-ng-manager/site/static/js/notifications.min.js
  3. 4
      lemonldap-ng-manager/site/static/languages/fr.json
  4. 2
      lemonldap-ng-manager/site/templates/notifications.tpl

@ -83,10 +83,17 @@
}).success(function(data) {
$scope.currentNotification = null;
$scope.currentScope.remove();
$scope.message = {
"title": "notificationDeleted",
};
$scope.showModal("alert.html");
$scope.waiting = false;
}).error(function(j, e) {
$scope.currentNotification = null;
$scope.currentScope.remove();
$scope.message = {
"title": "notificationNotDeleted",
"message": j.error
};
$scope.showModal("alert.html");
$scope.waiting = false;
});
}
@ -96,10 +103,17 @@
$http['delete'](scriptname + "notifications/" + $scope.type + "/" + $scope.currentNotification.done).success(function(data) {
$scope.currentNotification = null;
$scope.currentScope.remove();
$scope.message = {
"title": "notificationPurged",
};
$scope.showModal("alert.html");
$scope.waiting = false;
}).error(function(j, e) {
$scope.currentNotification = null;
$scope.currentScope.remove();
$scope.message = {
"title": "notificationNotPurged",
"message": j.error
};
$scope.showModal("alert.html");
$scope.waiting = false;
});
}

File diff suppressed because one or more lines are too long

@ -338,11 +338,11 @@
"notification": "Activation",
"notifications": "Notifications",
"notificationCreated": "La notification a été créée",
"notificationDeleted": "La notification supprimée",
"notificationDeleted": "La notification a été marquée comme lue",
"notificationDone": "notification validée",
"notificationsDone": "notifications validées",
"notificationNotCreated": "La notification n'a pas été créée",
"notificationNotDeleted": "La notification n'a pas été validée",
"notificationNotDeleted": "La notification n'a pas été marquée comme lue",
"notificationNotFound": "La notification n'a pas été trouvée",
"notificationNotPurged": "La notification n'a pas été définitivement supprimée",
"notificationPurged": "La notification a été définitivement supprimée",

@ -153,7 +153,7 @@
<div class="modal-header">
<h3 class="modal-title" trspan="{{elem('message').title}}" />
</div>
<div class="modal-body">
<div class="modal-body" ng-if="elem('message').message">
<div class="modal-p">{{translateP(elem('message').message)}}</div>
</div>
<div class="modal-footer">

Loading…
Cancel
Save