support batch editing user

This commit is contained in:
j 2023-08-04 13:54:49 +02:00
parent 89340133a9
commit f0681d7173

View file

@ -427,8 +427,11 @@ pandora.ui.infoView = function(data, isMixed) {
renderRightsLevel();
// User and Groups ---------------------------------------------------------
if (!isMultiple) {
if (!isMultiple || pandora.hasCapability('canEditUsers')) {
['user', 'groups'].forEach(function(key) {
if (key == 'groups' && isMultiple) {
return
};
(canEdit || data[key] && data[key].length) && $('<div>')
.css({marginBottom: '4px'})
.append(formatKey(key, 'statistics'))
@ -437,10 +440,14 @@ pandora.ui.infoView = function(data, isMixed) {
.css({margin: '2px 0 0 -1px'}) // fixme: weird
.append(
Ox.Editable({
placeholder: key == 'groups' ? formatLight(Ox._('No Groups')) : '',
placeholder: key == 'groups'
? formatLight(Ox._(isMixed[key] ? 'Mixed Groups' : 'No Groups'))
: isMixed[key] ? formatLight(Ox._('Mixed Users')) : '',
editable: canEdit,
tooltip: canEdit ? pandora.getEditTooltip() : '',
value: key == 'user' ? data[key] : data[key].join(', ')
value: isMixed[key] || !data[key]
? ''
: key == 'user' ? data[key] : data[key].join(', ')
})
.bindEvent({
submit: function(event) {