From 0da98d179fe31e30ea4ffd0639696e8d1f8f1f8d Mon Sep 17 00:00:00 2001 From: j Date: Tue, 1 Apr 2025 20:20:18 +0100 Subject: [PATCH] update InlineImages; show user info to staff/admin --- static/js/documentInfoView.leftovers.js | 75 ++++++++++++++++++------- 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/static/js/documentInfoView.leftovers.js b/static/js/documentInfoView.leftovers.js index d264c79..f1b4761 100644 --- a/static/js/documentInfoView.leftovers.js +++ b/static/js/documentInfoView.leftovers.js @@ -245,16 +245,11 @@ pandora.ui.documentInfoView = function(data, isMixed) { }) .appendTo($box); $('
') + .addClass("InlineImages") .append( Ox.EditableContent({ clickLink: pandora.clickLink, editable: false, - format: function(value) { - return value.replace( - /') + .addClass("InlineImages") .append( Ox.EditableContent({ clickLink: pandora.clickLink, editable: canEdit, - format: function(value) { - return value.replace( - /') + .addClass("InlineImages") .append( Ox.EditableContent({ clickLink: pandora.clickLink, editable: canEdit, - format: function(value) { - return value.replace( - /') + .css({marginBottom: '4px'}) + .append(formatKey(key, 'statistics')) + .append( + $('
') + .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) { $('
') .css({marginBottom: '4px'}) @@ -518,8 +552,7 @@ pandora.ui.documentInfoView = function(data, isMixed) { $('
').html(data.timesaccessed) ) .appendTo($statistics); - */ - + } // Rights Level ------------------------------------------------------------ var $rightsLevel = $('
');