From 48aba7bde81141c67f9280313f415df71ab56a2f Mon Sep 17 00:00:00 2001 From: j Date: Fri, 4 Aug 2023 13:54:36 +0200 Subject: [PATCH] support batch editing user --- static/js/infoView.padma.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/static/js/infoView.padma.js b/static/js/infoView.padma.js index 824849be..ffd59e3b 100644 --- a/static/js/infoView.padma.js +++ b/static/js/infoView.padma.js @@ -446,9 +446,12 @@ pandora.ui.infoView = function(data, isMixed) { pandora.renderRightsLevel(that, $rightsLevel, data, isMixed, isMultiple, canEdit); // User and Groups --------------------------------------------------------- - if (!isMultiple) { + if (!isMultiple || pandora.hasCapability('canEditUsers')) { ['user', 'groups'].forEach(function(key) { + if (key == 'groups' && isMultiple) { + return + }; var $input; (canEdit || data[key] && data[key].length) && $('
') .css({marginBottom: '4px'}) @@ -458,10 +461,14 @@ pandora.ui.infoView = function(data, isMixed) { .css({margin: '2px 0 0 -1px'}) // fixme: weird .append( $input = Ox.Editable({ - placeholder: key == 'groups' ? formatLight(Ox._(isMixed[key] ? 'Mixed Groups' : 'No Groups')) : '', + placeholder: key == 'groups' + ? formatLight(Ox._(isMixed[key] ? 'Mixed Groups' : 'No Groups')) + : isMixed[key] ? formatLight(Ox._('Mixed Users')) : '', editable: key == 'user' && canEdit, tooltip: canEdit ? pandora.getEditTooltip() : '', - value: key == 'user' ? data[key] : isMixed[key] ? '' : data[key].join(', ') + value: isMixed[key] + ? '' + : key == 'user' ? data[key] : data[key].join(', ') }) .bindEvent(Ox.extend({ submit: function(event) {