add comments field
This commit is contained in:
parent
f96c0b720f
commit
ab1578158d
1 changed files with 35 additions and 0 deletions
|
@ -368,6 +368,41 @@ pandora.ui.documentInfoView = function(data, isMixed) {
|
|||
.appendTo($statistics);
|
||||
renderRightsLevel();
|
||||
|
||||
// Comments ----------------------------------------------------------------
|
||||
|
||||
if (canEdit) {
|
||||
$('<div>')
|
||||
.css({marginBottom: '4px'})
|
||||
.append(
|
||||
formatKey('Comments', 'statistics').options({
|
||||
tooltip: Ox._('Only {0} can see and edit these comments', [
|
||||
Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) {
|
||||
return (
|
||||
i == 0 ? ''
|
||||
: i < Ox.len(pandora.site.capabilities.canEditMetadata) - 1 ? ', '
|
||||
: ' ' + Ox._('and') + ' '
|
||||
) + Ox.toTitleCase(level)
|
||||
}).join('')])
|
||||
})
|
||||
)
|
||||
.append(
|
||||
Ox.EditableContent({
|
||||
height: 128,
|
||||
placeholder: formatLight(Ox._(isMixed ? 'Mixed comments' : 'No comments')),
|
||||
tooltip: pandora.getEditTooltip(),
|
||||
type: 'textarea',
|
||||
value: data.comments || '',
|
||||
width: 128
|
||||
})
|
||||
.bindEvent({
|
||||
submit: function(event) {
|
||||
editMetadata('comments', event.value);
|
||||
}
|
||||
})
|
||||
)
|
||||
.appendTo($statistics);
|
||||
}
|
||||
|
||||
function editMetadata(key, value) {
|
||||
if (value != data[key]) {
|
||||
var edit = {
|
||||
|
|
Loading…
Reference in a new issue