Display allow list state in access modal

pull/1/head
yflory 5 years ago
parent 3647d583f8
commit 17113f298c

@ -853,34 +853,35 @@ define([
return $d; return $d;
}; };
var drawRight = function () { var drawRight = function () {
var content = [ // XXX allow_enabled, allow_disabled, allow_label
h('label', Messages.creation_owners), Messages.allow_enabled = 'ENABLED'; // XXX
]; Messages.allow_disabled = 'DISABLED'; // XXX
Messages.allow_label = 'Allow list: {0}'; // XXX
var content = [];
var _ownersGrid = getUserList(common, data.owners); var _ownersGrid = getUserList(common, data.owners);
if (_ownersGrid && _ownersGrid.div) { if (_ownersGrid && _ownersGrid.div) {
content.push(h('label', Messages.creation_owners));
content.push(_ownersGrid.div); content.push(_ownersGrid.div);
} else { } else {
content.push(UI.dialog.selectable(Messages.creation_noOwner, { content.push(UI.dialog.selectable(Messages.creation_noOwner, {
id: 'cp-app-prop-owners', id: 'cp-app-prop-owners',
})); }));
content.push(h('div.cp-app-prop', [
Messages.creation_expiration,
h('br'),
h('span.cp-app-prop-content', expire)
]));
} }
/* var state = data.restricted ? Messages.allow_enabled : Messages.allow_disabled;
var owned = isOwned(common, data); content.push(h('label', Messages._getKey('allow_label', [state])));
var parsed = Hash.parsePadUrl(data.href || data.roHref); if (data.restricted) {
if (!parsed || !parsed.hashData) { return; } var _allowed = Util.deduplicateString(data.owners.concat(data.allowed));
if (owned && parsed.hashData.type === 'pad') { var _allowedGrid = getUserList(common, _allowed);
var manageOwners = h('button.no-margin', Messages.owner_openModalButton); content.push(_allowedGrid.div);
$(manageOwners).click(function () {
data.teamId = typeof(owned) !== "boolean" ? owned : undefined;
var modal = createOwnerModal(common, data);
UI.openCustomModal(modal, {
wide: true,
});
});
$d.append(h('p', manageOwners));
} }
*/
return h('div', content); return h('div', content);
}; };

Loading…
Cancel
Save