2022-08-04 19:50:18 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
Template.userMgmt.onCreated(function() {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.userMgmt.onRendered(function() {
|
2022-08-05 16:55:56 -05:00
|
|
|
$('select').formSelect();
|
2022-08-04 19:50:18 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.userMgmt.helpers({
|
2022-08-05 16:55:56 -05:00
|
|
|
userInfo: function() {
|
|
|
|
|
return Meteor.users.find({});
|
|
|
|
|
},
|
|
|
|
|
userName: function() {
|
|
|
|
|
return this.profile.fullname;
|
|
|
|
|
},
|
|
|
|
|
userEmail: function() {
|
|
|
|
|
return this.emails[0].address;
|
|
|
|
|
},
|
|
|
|
|
userRole: function() {
|
|
|
|
|
return Roles.getRolesForUser( this._id );
|
|
|
|
|
}
|
2022-08-04 19:50:18 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.userMgmt.events({
|
2022-08-05 16:55:56 -05:00
|
|
|
"click .editUser" (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
|
|
let userId = this._id;
|
|
|
|
|
// take action
|
|
|
|
|
console.log("Edit called on: " + userId);
|
|
|
|
|
},
|
|
|
|
|
"click .deleteUser" (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
|
|
let userId = this._id;
|
|
|
|
|
// take action
|
|
|
|
|
console.log("Delete called on : " + userId);
|
|
|
|
|
}
|
2022-08-04 19:50:18 -05:00
|
|
|
});
|