mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
36 lines
862 B
JavaScript
36 lines
862 B
JavaScript
Template.users_list_actions.helpers({
|
|
isInvited: function() {
|
|
return this.isInvited;
|
|
},
|
|
userIsAdmin: function(){
|
|
return isAdmin(this);
|
|
},
|
|
});
|
|
|
|
Template.users_list_actions.events({
|
|
'click .invite-link': function(e){
|
|
e.preventDefault();
|
|
Meteor.call('inviteUser', { userId : this._id });
|
|
},
|
|
'click .uninvite-link': function(e){
|
|
e.preventDefault();
|
|
Meteor.users.update(this._id,{
|
|
$set:{
|
|
isInvited: false
|
|
}
|
|
});
|
|
},
|
|
'click .admin-link': function(e){
|
|
e.preventDefault();
|
|
updateAdmin(this._id, true);
|
|
},
|
|
'click .unadmin-link': function(e){
|
|
e.preventDefault();
|
|
updateAdmin(this._id, false);
|
|
},
|
|
'click .delete-link': function(e){
|
|
e.preventDefault();
|
|
if(confirm(i18n.t("are_you_sure_you_want_to_delete")+getDisplayName(this)+"?"))
|
|
Meteor.users.remove(this._id);
|
|
}
|
|
});
|