Demote yourself
This commit is contained in:
parent
22d5e417e4
commit
590e6bd211
@ -1212,5 +1212,6 @@
|
|||||||
"team_deleteTitle": "Team deletion",
|
"team_deleteTitle": "Team deletion",
|
||||||
"team_deleteHint": "Delete the team and all documents owned exclusively by the team.",
|
"team_deleteHint": "Delete the team and all documents owned exclusively by the team.",
|
||||||
"team_deleteButton": "Delete",
|
"team_deleteButton": "Delete",
|
||||||
"team_deleteConfirm": "You are about to delete all of an entire team's data. This may impact other team members access to their data. This cannot be undone. Are you sure you want to proceed?"
|
"team_deleteConfirm": "You are about to delete all of an entire team's data. This may impact other team members access to their data. This cannot be undone. Are you sure you want to proceed?",
|
||||||
|
"team_demoteMeConfirm": "You are about to give up your rights. You will not be able to undo this action. Are you sure?"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -452,7 +452,9 @@ define([
|
|||||||
// Name
|
// Name
|
||||||
var name = h('span.cp-team-member-name', data.displayName);
|
var name = h('span.cp-team-member-name', data.displayName);
|
||||||
if (data.pendingOwner) {
|
if (data.pendingOwner) {
|
||||||
$(name).append(h('em', " PENDING")); // XXX
|
$(name).append(h('em', {
|
||||||
|
title: Messages.team_pendingOwnerTitle
|
||||||
|
}, ' ' + Messages.team_pendingOwner));
|
||||||
// + XXX ability to demote yourself as owner if there is another owner
|
// + XXX ability to demote yourself as owner if there is another owner
|
||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
@ -501,16 +503,25 @@ define([
|
|||||||
}
|
}
|
||||||
// If I'm not a member and I have an equal or higher role than them, I can demote them
|
// If I'm not a member and I have an equal or higher role than them, I can demote them
|
||||||
// (if they're not already a MEMBER)
|
// (if they're not already a MEMBER)
|
||||||
if (!isMe && myRole >= theirRole && theirRole > 0 && !data.pending) {
|
if (myRole >= theirRole && theirRole > 0 && !data.pending) {
|
||||||
var demote = h('span.fa.fa-angle-double-down', {
|
var demote = h('span.fa.fa-angle-double-down', {
|
||||||
title: Messages.team_rosterDemote
|
title: Messages.team_rosterDemote
|
||||||
});
|
});
|
||||||
$(demote).click(function () {
|
$(demote).click(function () {
|
||||||
var role = ROLES[theirRole - 1] || 'MEMBER';
|
var todo = function () {
|
||||||
$(demote).hide();
|
var role = ROLES[theirRole - 1] || 'MEMBER';
|
||||||
describeUser(common, data.curvePublic, {
|
$(demote).hide();
|
||||||
role: role
|
describeUser(common, data.curvePublic, {
|
||||||
}, promote);
|
role: role
|
||||||
|
}, promote);
|
||||||
|
};
|
||||||
|
if (isMe) {
|
||||||
|
return void UI.confirm(Messages.team_demoteMeConfirm, function (yes) {
|
||||||
|
if (!yes) { return; }
|
||||||
|
todo();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
todo();
|
||||||
});
|
});
|
||||||
$actions.append(demote);
|
$actions.append(demote);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user