update InlineImages; show user info to staff/admin
This commit is contained in:
parent
1c3963248f
commit
0da98d179f
1 changed files with 54 additions and 21 deletions
|
|
@ -245,16 +245,11 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
||||||
})
|
})
|
||||||
.appendTo($box);
|
.appendTo($box);
|
||||||
$('<div>')
|
$('<div>')
|
||||||
|
.addClass("InlineImages")
|
||||||
.append(
|
.append(
|
||||||
Ox.EditableContent({
|
Ox.EditableContent({
|
||||||
clickLink: pandora.clickLink,
|
clickLink: pandora.clickLink,
|
||||||
editable: false,
|
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))])),
|
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
|
||||||
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
|
|
@ -348,16 +343,11 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
||||||
})
|
})
|
||||||
.appendTo($text);
|
.appendTo($text);
|
||||||
$('<div>')
|
$('<div>')
|
||||||
|
.addClass("InlineImages")
|
||||||
.append(
|
.append(
|
||||||
Ox.EditableContent({
|
Ox.EditableContent({
|
||||||
clickLink: pandora.clickLink,
|
clickLink: pandora.clickLink,
|
||||||
editable: canEdit,
|
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,
|
maxHeight: Infinity,
|
||||||
placeholder: formatLight(Ox._('No Description')),
|
placeholder: formatLight(Ox._('No Description')),
|
||||||
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
||||||
|
|
@ -387,16 +377,11 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
||||||
})
|
})
|
||||||
.appendTo($text);
|
.appendTo($text);
|
||||||
$('<div>')
|
$('<div>')
|
||||||
|
.addClass("InlineImages")
|
||||||
.append(
|
.append(
|
||||||
Ox.EditableContent({
|
Ox.EditableContent({
|
||||||
clickLink: pandora.clickLink,
|
clickLink: pandora.clickLink,
|
||||||
editable: canEdit,
|
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,
|
maxHeight: Infinity,
|
||||||
placeholder: formatLight(Ox._('No Content')),
|
placeholder: formatLight(Ox._('No Content')),
|
||||||
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
||||||
|
|
@ -501,7 +486,56 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
||||||
.appendTo($statistics);
|
.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) {
|
['created', 'modified'].forEach(function(key) {
|
||||||
$('<div>')
|
$('<div>')
|
||||||
.css({marginBottom: '4px'})
|
.css({marginBottom: '4px'})
|
||||||
|
|
@ -518,8 +552,7 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
||||||
$('<div>').html(data.timesaccessed)
|
$('<div>').html(data.timesaccessed)
|
||||||
)
|
)
|
||||||
.appendTo($statistics);
|
.appendTo($statistics);
|
||||||
*/
|
}
|
||||||
|
|
||||||
// Rights Level ------------------------------------------------------------
|
// Rights Level ------------------------------------------------------------
|
||||||
|
|
||||||
var $rightsLevel = $('<div>');
|
var $rightsLevel = $('<div>');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue