update InlineImages; show user info to staff/admin

This commit is contained in:
j 2025-04-01 20:20:18 +01:00
commit 0da98d179f

View file

@ -245,16 +245,11 @@ pandora.ui.documentInfoView = function(data, isMixed) {
})
.appendTo($box);
$('<div>')
.addClass("InlineImages")
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: false,
format: function(value) {
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
@ -348,16 +343,11 @@ pandora.ui.documentInfoView = function(data, isMixed) {
})
.appendTo($text);
$('<div>')
.addClass("InlineImages")
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: canEdit,
format: function(value) {
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
maxHeight: Infinity,
placeholder: formatLight(Ox._('No Description')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
@ -387,16 +377,11 @@ pandora.ui.documentInfoView = function(data, isMixed) {
})
.appendTo($text);
$('<div>')
.addClass("InlineImages")
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
editable: canEdit,
format: function(value) {
return value.replace(
/<img src=/g,
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
maxHeight: Infinity,
placeholder: formatLight(Ox._('No Content')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
@ -501,7 +486,56 @@ pandora.ui.documentInfoView = function(data, isMixed) {
.appendTo($statistics);
});
/*
// User and Groups ---------------------------------------------------------
if (!isMultiple && pandora.hasCapability('canManageUsers', pandora.user.level) {
['user', 'groups'].forEach(function(key) {
var $input;
(canEdit || data[key] && data[key].length) && $('<div>')
.css({marginBottom: '4px'})
.append(formatKey(key, 'statistics'))
.append(
$('<div>')
.css({margin: '2px 0 0 -1px'}) // fixme: weird
.append(
$input = Ox.Editable({
placeholder: key == 'groups' ? formatLight(Ox._('No Groups')) : '',
editable: key == 'user' && canEdit,
tooltip: canEdit ? pandora.getEditTooltip() : '',
value: key == 'user' ? data[key] : data[key].join(', ')
})
.bindEvent(Ox.extend({
submit: function(event) {
editMetadata(key, event.value);
}
}, key == 'groups' ? {
doubleclick: canEdit ? function() {
setTimeout(function() {
if (window.getSelection) {
window.getSelection().removeAllRanges();
} else if (document.selection) {
document.selection.empty();
}
});
pandora.$ui.groupsDialog = pandora.ui.groupsDialog({
id: data.id,
name: data.title,
type: 'document'
})
.bindEvent({
groups: function(data) {
$input.options({
value: data.groups.join(', ')
});
}
})
.open();
} : function() {}
} : {}))
)
)
.appendTo($statistics);
});
['created', 'modified'].forEach(function(key) {
$('<div>')
.css({marginBottom: '4px'})
@ -518,8 +552,7 @@ pandora.ui.documentInfoView = function(data, isMixed) {
$('<div>').html(data.timesaccessed)
)
.appendTo($statistics);
*/
}
// Rights Level ------------------------------------------------------------
var $rightsLevel = $('<div>');