update info view

This commit is contained in:
Rolux 2015-09-21 17:23:22 +01:00
parent 5e8c51717e
commit 7f6de43e43

View file

@ -208,7 +208,83 @@ pandora.ui.infoView = function(data) {
pandora.createLinks($info); pandora.createLinks($info);
} }
// depositor & collection -------------------------------------------------------- // Title -------------------------------------------------------------------
$('<div>')
.css({
marginTop: '-2px',
marginBottom: '12px'
})
.append(
Ox.EditableContent({
editable: canEdit,
placeholder: formatLight(Ox._('No Title')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
value: data.title
})
.css({
fontWeight: 'bold',
fontSize: '13px'
})
.bindEvent({
submit: function(event) {
editMetadata('title', event.value);
}
})
)
.appendTo($text);
// Groups ------------------------------------------------------------------
renderGroup(['location', 'date', 'language', 'format']);
renderGroup([
'director', 'cinematographer', 'editor',
'writer', 'producer', 'featuring'
]);
renderGroup(['themes']);
// Summary -------------------------------------------------------------
if (canEdit || data.summary) {
$('<div>')
.css({
marginTop: '12px',
marginBottom: '12px'
})
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
collapseToEnd: false,
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 Summary')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: data.summary || ''
})
.css(css)
.css({
overflow: 'hidden'
})
.bindEvent({
submit: function(event) {
editMetadata('summary', event.value);
}
})
)
.appendTo($text);
$('<div>').css({width: '1px', height: 0, clear: 'both'}).appendTo($text);
}
// depositor & collection --------------------------------------------------
['collection', 'depositor'].forEach(function(key) { ['collection', 'depositor'].forEach(function(key) {
if (canEdit || data[key]) { if (canEdit || data[key]) {
@ -273,82 +349,6 @@ pandora.ui.infoView = function(data) {
} }
}); });
// Title -------------------------------------------------------------------
$('<div>')
.css({
marginTop: '-2px',
marginBottom: '12px'
})
.append(
Ox.EditableContent({
editable: canEdit,
placeholder: formatLight(Ox._('No Title')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
value: data.title
})
.css({
fontWeight: 'bold',
fontSize: '13px'
})
.bindEvent({
submit: function(event) {
editMetadata('title', event.value);
}
})
)
.appendTo($text);
// Groups ------------------------------------------------------------------
renderGroup(['location', 'date', 'language']);
renderGroup([
'director', 'cinematographer', 'editor',
'writer', 'producer', 'featuring'
]);
renderGroup(['themes']);
// Summary -------------------------------------------------------------
if (canEdit || data.summary) {
$('<div>')
.css({
marginTop: '12px',
marginBottom: '12px'
})
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
collapseToEnd: false,
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 Summary')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: data.summary || ''
})
.css(css)
.css({
overflow: 'hidden'
})
.bindEvent({
submit: function(event) {
editMetadata('summary', event.value);
}
})
)
.appendTo($text);
$('<div>').css({width: '1px', height: 0, clear: 'both'}).appendTo($text);
}
$('<div>') $('<div>')
.addClass('OxSelectable') .addClass('OxSelectable')
.css(css) .css(css)