2015-02-12 23:28:14 -05:00
|
|
|
Template[getTemplate('users_list_actions')].helpers({
|
|
|
|
isInvited: function() {
|
|
|
|
return this.isInvited;
|
|
|
|
},
|
|
|
|
userIsAdmin: function(){
|
|
|
|
return isAdmin(this);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
Template[getTemplate('users_list_actions')].events({
|
2015-02-16 17:57:05 -05:00
|
|
|
'click .invite-link': function(e){
|
2015-02-12 23:28:14 -05:00
|
|
|
e.preventDefault();
|
2015-02-16 17:57:05 -05:00
|
|
|
Meteor.call('inviteUser', { userId : this._id });
|
2015-02-12 23:28:14 -05:00
|
|
|
},
|
2015-02-16 17:57:05 -05:00
|
|
|
'click .uninvite-link': function(e){
|
2015-02-12 23:28:14 -05:00
|
|
|
e.preventDefault();
|
2015-02-16 17:57:05 -05:00
|
|
|
Meteor.users.update(this._id,{
|
2015-02-12 23:28:14 -05:00
|
|
|
$set:{
|
|
|
|
isInvited: false
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
2015-02-16 17:57:05 -05:00
|
|
|
'click .admin-link': function(e){
|
2015-02-12 23:28:14 -05:00
|
|
|
e.preventDefault();
|
2015-02-16 17:57:05 -05:00
|
|
|
updateAdmin(this._id, true);
|
2015-02-12 23:28:14 -05:00
|
|
|
},
|
2015-02-16 17:57:05 -05:00
|
|
|
'click .unadmin-link': function(e){
|
2015-02-12 23:28:14 -05:00
|
|
|
e.preventDefault();
|
2015-02-16 17:57:05 -05:00
|
|
|
updateAdmin(this._id, false);
|
2015-02-12 23:28:14 -05:00
|
|
|
},
|
2015-02-16 17:57:05 -05:00
|
|
|
'click .delete-link': function(e){
|
2015-02-12 23:28:14 -05:00
|
|
|
e.preventDefault();
|
2015-02-16 17:57:05 -05:00
|
|
|
if(confirm(i18n.t("are_you_sure_you_want_to_delete")+getDisplayName(this)+"?"))
|
|
|
|
Meteor.users.remove(this._id);
|
2015-02-12 23:28:14 -05:00
|
|
|
}
|
|
|
|
});
|