branch develop updated (1a2e74b -> dc38845)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository mum. See http://git.chorem.org/mum.git from 1a2e74b notifications page : correction du code pour l'affichage des données de notification new e3fb6b0 notifications page : bouton et action pour la désinscription d'un utilisateur ajoutés new 2c2cdc0 notifications page : titre dynamique pour le modal d'inscription new dc38845 notifications page : 'all' retiré de la liste des groupes + ajout de la sélection dans le titre The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit dc3884555b7cb10f08dff18dc1c85a914a67f74f Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 20 17:02:27 2015 +0100 notifications page : 'all' retiré de la liste des groupes + ajout de la sélection dans le titre commit 2c2cdc0c93ab4852e4634eca2c3592d1bf29b406 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 20 16:34:13 2015 +0100 notifications page : titre dynamique pour le modal d'inscription 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 Summary of changes: static/js/controllers/notificationsCtrl.js | 30 +++++++++++++++++++++- views/notifications.html | 41 ++++-------------------------- 2 files changed, 34 insertions(+), 37 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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>.
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 2c2cdc0c93ab4852e4634eca2c3592d1bf29b406 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 20 16:34:13 2015 +0100 notifications page : titre dynamique pour le modal d'inscription --- static/js/controllers/notificationsCtrl.js | 8 ++++++++ views/notifications.html | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/static/js/controllers/notificationsCtrl.js b/static/js/controllers/notificationsCtrl.js index 7f15d4a..cb25e87 100644 --- a/static/js/controllers/notificationsCtrl.js +++ b/static/js/controllers/notificationsCtrl.js @@ -143,6 +143,14 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, Data mumApp.controller('ModalAddSubscriberInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, add_subscriber_args) { $scope.add_subscriber_args = add_subscriber_args; /* {'grp': val, 'host': val */ + $scope.modal_title = "Add users to "; + if($scope.add_subscriber_args['grp'] != ""){ + $scope.modal_title += " group " + $scope.add_subscriber_args['grp']; + } + else{ + $scope.modal_title += " host " + $scope.add_subscriber_args['host']['addr']; + } + $scope.users = {}; $scope.selected_users = []; diff --git a/views/notifications.html b/views/notifications.html index c51a358..c024c87 100644 --- a/views/notifications.html +++ b/views/notifications.html @@ -85,10 +85,9 @@ <script type="text/ng-template" id="modal_add_subscriber_label.html"> <div class="modal-header"> - <h3 class="modal-title">Add users to this group/host</h3> + <h3 class="modal-title">{{modal_title}}</h3> </div> <div class="modal-body"> - {{add_subscriber_args}} <select multiple class="form-control" ng-model="selected_users" ng-options="user as user for user in users"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 dc3884555b7cb10f08dff18dc1c85a914a67f74f Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 20 17:02:27 2015 +0100 notifications page : 'all' retiré de la liste des groupes + ajout de la sélection dans le titre --- static/js/controllers/notificationsCtrl.js | 9 +++++++- views/notifications.html | 35 ++---------------------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/static/js/controllers/notificationsCtrl.js b/static/js/controllers/notificationsCtrl.js index cb25e87..3557407 100644 --- a/static/js/controllers/notificationsCtrl.js +++ b/static/js/controllers/notificationsCtrl.js @@ -17,6 +17,8 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, Data ] */ + $scope.subtitle = ""; + $scope.notif_mods = {}; // {notif_mod :{param1:val1, param2:val2, ...}} $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_NOTIF_MOD": ""})); @@ -32,11 +34,14 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, Data $scope.subscriber_data_unchanged = {}; // used to discard changes + // returns all groups except 'all' $scope.allGroups = function(){ var res = [] for(var i = 0; i<$scope.items.length; i++){ for(var j = 0; j<$scope.items[i].group.length; j++){ - res.push($scope.items[i].group[j]); + if($scope.items[i].group[j] != 'all'){ + res.push($scope.items[i].group[j]); + } } } return res; @@ -48,6 +53,7 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, Data $scope.option_selected = ""; // 'grp' OR 'host' $scope.get_group_subscribers = function(){ + $scope.subtitle = "Group " + $scope.selected_grp; if($scope.selected_grp != ""){ var args = {'group': $scope.selected_grp}; $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_group_subscribers', 'args': args}})); @@ -55,6 +61,7 @@ mumApp.controller('notificationsCtrl', function($scope, $rootScope, $modal, Data } $scope.get_host_subscribers = function(){ + $scope.subtitle = $scope.selected_host['addr'] + '('+ $scope.selected_host['name'] + ')'; if($scope.selected_host != ""){ var args = {'addr_host': $scope.selected_host['addr']}; $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_host_subscribers', 'args': args}})); diff --git a/views/notifications.html b/views/notifications.html index c024c87..f150519 100644 --- a/views/notifications.html +++ b/views/notifications.html @@ -1,10 +1,6 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Who to notify?</h1> - <!--<h2 class="sub-header">They will be applied on each new host you will add.</h2>--> - {{selected_host}}<br/> - {{subscriber_data}}<br/> - {{notif_mods}}<br/> + <h1 class="page-header">Who to notify? <small>{{subtitle}}</small></h1> <form> <div class="row"> <div class="col-lg-6"> @@ -36,10 +32,6 @@ </div> </div> </div> - - - - </form> <div ng-show="selected_host!='' || selected_grp!=''"> <p>Check the box if you want the user to be notified by the correspondant service.</p> @@ -97,27 +89,4 @@ <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">Close</button> <button type="button" class="btn btn-primary" ng-click="ok()" ng-disabled="selected_users.length==0">Add selected</button> </div> - </script> - - <!--<div class="modal fade" id="modal_add" tabindex="-1" role="dialog" aria-labelledby="modal_add_label" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="modal_add_label">Add users to this group/host</h4> - </div> - <div class="modal-body"> - <select multiple class="form-control"> - <option>D.D.</option> - <option>J.D.</option> - <option>X.R.</option> - </select> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> - <button type="button" class="btn btn-primary">Add selected</button> - </div> - </div> - </div> - </div>--> - + </script> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm