update info view js files and config

This commit is contained in:
rlx 2017-12-15 13:53:01 +00:00
commit 0f086373a5
3 changed files with 74 additions and 50 deletions

View file

@ -223,11 +223,13 @@ pandora.ui.documentInfoView = function(data) {
)
.appendTo($text);
// Director, Year and Country ----------------------------------------------
// Work, Author, etc. ------------------------------------------------------
renderGroup(['author', 'date', 'type']);
renderGroup(['version', 'versionauthor', 'work', 'workauthor']);
renderGroup(['publisher', 'place', 'series', 'edition', 'language']);
renderGroup(['work', 'version', 'type']);
renderGroup(['author', 'versionauthor']);
renderGroup(['place', 'date', 'language']);
renderGroup(['keywords']);
// Description -------------------------------------------------------------
@ -359,6 +361,41 @@ pandora.ui.documentInfoView = function(data) {
.appendTo($statistics);
renderRightsLevel();
// Notes -------------------------------------------------------------------
if (canEdit) {
$('<div>')
.css({marginBottom: '4px'})
.append(
formatKey('Notes', '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._('No notes')),
tooltip: pandora.getEditTooltip(),
type: 'textarea',
value: data.notes || '',
width: 128
})
.bindEvent({
submit: function(event) {
editMetadata('notes', event.value);
}
})
)
.appendTo($statistics);
}
function editMetadata(key, value) {
if (value != data[key]) {
var edit = {id: data.id};

View file

@ -225,16 +225,15 @@ pandora.ui.infoView = function(data) {
)
.appendTo($text);
// Author, Year and Country ----------------------------------------------
// Work, Author, etc. ------------------------------------------------------
renderGroup(['author', 'year', 'country']);
renderGroup(['version', 'versionauthor', 'work', 'workauthor']);
renderGroup(['work', 'version']);
renderGroup(['author', 'versionauthor']);
renderGroup(['location', 'date', 'language']);
// Featuring ----------------------------------------------
renderGroup(['keywords']);
renderGroup(['featuring']);
// Summary -----------------------------------------------------------------
// Description -------------------------------------------------------------
if (canEdit || data.summary) {
$('<div>')
@ -323,7 +322,7 @@ pandora.ui.infoView = function(data) {
.appendTo($statistics);
renderRightsLevel();
// Notes --------------------------------------------------------------------
// Notes -------------------------------------------------------------------
if (canEdit) {
$('<div>')