|
|
@ -443,12 +443,13 @@ define([
|
|
|
|
var theirRole = ROLES.indexOf(data.role) || 0;
|
|
|
|
var theirRole = ROLES.indexOf(data.role) || 0;
|
|
|
|
// If they're an admin and I am an owner, I can promote them to owner
|
|
|
|
// If they're an admin and I am an owner, I can promote them to owner
|
|
|
|
if (!isMe && myRole > theirRole && theirRole === 1 && !data.pending) {
|
|
|
|
if (!isMe && myRole > theirRole && theirRole === 1 && !data.pending) {
|
|
|
|
var promote = h('span.fa.fa-angle-double-up', {
|
|
|
|
var promoteOwner = h('span.fa.fa-angle-double-up', {
|
|
|
|
title: "Offer ownership" // XXX
|
|
|
|
title: "Offer ownership" // XXX
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$(promote).click(function () {
|
|
|
|
$(promoteOwner).click(function () {
|
|
|
|
$(promote).hide();
|
|
|
|
$(promoteOwner).hide();
|
|
|
|
UI.confirm("Are you sure???", function (yes) { // XXX
|
|
|
|
UI.confirm("Are you sure???", function (yes) { // XXX
|
|
|
|
|
|
|
|
if (!yes) { return; }
|
|
|
|
APP.module.execCommand('OFFER_OWNERSHIP', {
|
|
|
|
APP.module.execCommand('OFFER_OWNERSHIP', {
|
|
|
|
teamId: APP.team,
|
|
|
|
teamId: APP.team,
|
|
|
|
curvePublic: data.curvePublic
|
|
|
|
curvePublic: data.curvePublic
|
|
|
@ -461,7 +462,7 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$actions.append(promote);
|
|
|
|
$actions.append(promoteOwner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// If they're a member and I have a higher role than them, I can promote them to admin
|
|
|
|
// If they're a member and I have a higher role than them, I can promote them to admin
|
|
|
|
if (!isMe && myRole > theirRole && theirRole === 0 && !data.pending) {
|
|
|
|
if (!isMe && myRole > theirRole && theirRole === 0 && !data.pending) {
|
|
|
@ -754,6 +755,7 @@ define([
|
|
|
|
$(deleteTeam).click(function () {
|
|
|
|
$(deleteTeam).click(function () {
|
|
|
|
if (deleting) { return; }
|
|
|
|
if (deleting) { return; }
|
|
|
|
UI.confirm("Are you sure", function (yes) { // XXX
|
|
|
|
UI.confirm("Are you sure", function (yes) { // XXX
|
|
|
|
|
|
|
|
if (!yes) { return; }
|
|
|
|
if (deleting) { return; }
|
|
|
|
if (deleting) { return; }
|
|
|
|
deleting = true;
|
|
|
|
deleting = true;
|
|
|
|
$spinner.show();
|
|
|
|
$spinner.show();
|
|
|
@ -761,7 +763,7 @@ define([
|
|
|
|
teamId: APP.team
|
|
|
|
teamId: APP.team
|
|
|
|
}, function (obj) {
|
|
|
|
}, function (obj) {
|
|
|
|
$spinner.hide();
|
|
|
|
$spinner.hide();
|
|
|
|
deleting = false
|
|
|
|
deleting = false;
|
|
|
|
if (obj && obj.error) {
|
|
|
|
if (obj && obj.error) {
|
|
|
|
return void UI.warn(obj.error);
|
|
|
|
return void UI.warn(obj.error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|