This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit e3fb6b0dc34fbffed7ca1abf2275c6121e40c56b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 20 16:25:59 2015 +0100 notifications page : bouton et action pour la désinscription d'un utilisateur ajoutés --- static/js/controllers/notificationsCtrl.js | 13 +++++++++++++ views/notifications.html | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/static/js/controllers/notificationsCtrl.js b/static/js/controllers/notificationsCtrl.js index 36a9a62..7f15d4a 100644 --- a/static/js/controllers/notificationsCtrl.js +++ b/static/js/controllers/notificationsCtrl.js @@ -113,6 +113,19 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, Data } } + $scope.unsubscribe = function(username){ + var args = {}; + args['username'] = username; + if($scope.option_selected == 'grp'){ + args['group'] = $scope.selected_grp; + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'unsubscribe_to_group', 'args': args}})); + } + else{ + args['addr_host'] = $scope.selected_host.addr; + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'unsubscribe_to_host', 'args': args}})); + } + } + $scope.open_modal_add_subscriber = function (mod_name) { var modalInstance = $modal.open({ templateUrl: 'modal_add_subscriber_label.html', diff --git a/views/notifications.html b/views/notifications.html index 01efedf..c51a358 100644 --- a/views/notifications.html +++ b/views/notifications.html @@ -56,7 +56,8 @@ </thead> <tbody> <tr ng-repeat="(username, user) in subscriber_data"> - <td>{{username}}</td> + <td>{{username}}<br/> + <button type="button" class="btn btn-danger btn-xs" ng-click="unsubscribe(username)">Unsubscribe</button></td> <td ng-repeat="(mod_name, mod_param) in user.minor">{{mod_name}}</td> <td ng-repeat="(mod_name, mod_param) in user.minor"> <div class="input-group"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.