add content, rename. Associated->Related

This commit is contained in:
j 2019-10-14 15:48:16 +01:00
parent 477d43d9de
commit 168fe02186
2 changed files with 43 additions and 4 deletions

View File

@ -312,9 +312,9 @@
"columnWidth": 256
},
{
"id": "associatedpeople",
"id": "relatedpeople",
"operator": "+",
"title": "Associated people",
"title": "Related people",
"type": ["string"],
"filter": true,
"find": true,
@ -375,7 +375,14 @@
"title": "Description",
"type": "text",
"find": true,
"sort": true,
"columnWidth": 256
},
{
"id": "content",
"operator": "+",
"title": "Content",
"type": "text",
"find": true,
"columnWidth": 256
},
{

View File

@ -232,7 +232,7 @@ pandora.ui.documentInfoView = function(data, isMixed) {
renderGroup(['author', 'date', 'format']);
renderGroup(['publisher', 'place', 'series', 'volume', 'language']);
renderGroup(['source', 'links']);
renderGroup(['movement', 'event', 'associatedgroups', 'associatedpeople']);
renderGroup(['movement', 'event', 'associatedgroups', 'relatedpeople']);
renderGroup(['tags']);
// Description -------------------------------------------------------------
@ -269,6 +269,38 @@ pandora.ui.documentInfoView = function(data, isMixed) {
.appendTo($text);
}
if (canEdit || data.content) {
$('<div>')
.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() : '',
type: 'textarea',
value: data.content || ''
})
.css(css)
.css({
marginTop: '12px',
overflow: 'hidden'
})
.bindEvent({
submit: function(event) {
editMetadata('content', event.value);
}
})
)
.appendTo($text);
}
// Preview
if (data.extension == 'pdf' && !isMultiple) {
var $div = $('<div>').css({