Demote yourself

pull/1/head
yflory 2019-10-01 11:57:21 +02:00
parent 22d5e417e4
commit 590e6bd211
2 changed files with 20 additions and 8 deletions

View File

@ -1212,5 +1212,6 @@
"team_deleteTitle": "Team deletion",
"team_deleteHint": "Delete the team and all documents owned exclusively by the team.",
"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?"
}

View File

@ -452,7 +452,9 @@ define([
// Name
var name = h('span.cp-team-member-name', data.displayName);
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
}
// 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 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', {
title: Messages.team_rosterDemote
});
$(demote).click(function () {
var role = ROLES[theirRole - 1] || 'MEMBER';
$(demote).hide();
describeUser(common, data.curvePublic, {
role: role
}, promote);
var todo = function () {
var role = ROLES[theirRole - 1] || 'MEMBER';
$(demote).hide();
describeUser(common, data.curvePublic, {
role: role
}, promote);
};
if (isMe) {
return void UI.confirm(Messages.team_demoteMeConfirm, function (yes) {
if (!yes) { return; }
todo();
});
}
todo();
});
$actions.append(demote);
}