cleanup
This commit is contained in:
parent
ee22835c96
commit
dfa46712a8
2 changed files with 15 additions and 166 deletions
16
config.jsonc
16
config.jsonc
|
@ -40,7 +40,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"capabilities": {
|
||||
"canAddItems": {"member": true, "staff": true, "admin": true},
|
||||
"canAddDocuments": {"member": true, "staff": true, "admin": true},
|
||||
"canDownloadVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canDownloadVideo": {"guest": 0, "member": 0, "staff": 1, "admin": 1},
|
||||
"canEditAnnotations": {"staff": true, "admin": true},
|
||||
"canEditDocuments": {"staff": true, "admin": true},
|
||||
"canEditEntities": {"staff": true, "admin": true},
|
||||
|
@ -64,8 +64,8 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"canManagePlacesAndEvents": {"member": true, "staff": true, "admin": true},
|
||||
"canManageTitlesAndNames": {"member": true, "staff": true, "admin": true},
|
||||
"canManageUsers": {"staff": true, "admin": true},
|
||||
"canPlayClips": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canPlayVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canPlayClips": {"guest": 0, "member": 0, "staff": 1, "admin": 1},
|
||||
"canPlayVideo": {"guest": 0, "member": 0, "staff": 1, "admin": 1},
|
||||
"canReadText": {"guest": 0, "member": 0, "staff": 1, "admin": 1},
|
||||
"canRemoveItems": {"admin": true},
|
||||
"canRemoveDocuments": {"admin": true},
|
||||
|
@ -74,8 +74,8 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"canSeeDebugMenu": {"staff": true, "admin": true},
|
||||
"canSeeExtraItemViews": {"staff": true, "admin": true},
|
||||
"canSeeMedia": {"staff": true, "admin": true},
|
||||
"canSeeDocument": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canSeeItem": {"guest": 1, "member": 1, "staff": 4, "admin": 4},
|
||||
"canSeeDocument": {"guest": 0, "member": 0, "staff": 1, "admin": 1},
|
||||
"canSeeItem": {"guest": 0, "member": 0, "staff": 1, "admin": 1},
|
||||
"canSeeSize": {"staff": true, "admin": true},
|
||||
"canSeeSoftwareVersion": {"staff": true, "admin": true},
|
||||
"canSendMail": {"admin": true}
|
||||
|
@ -577,7 +577,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"title": "Version",
|
||||
"type": "string",
|
||||
"columnWidth": 128,
|
||||
"find": true,
|
||||
"find": true
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -1045,6 +1045,8 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"item": "Keyword",
|
||||
"autocomplete": true,
|
||||
"overlap": true,
|
||||
"hasEvents": true,
|
||||
"hasPlaces": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
|
@ -1137,7 +1139,7 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"rightsLevel" defines which initial rights level will be assigned to items
|
||||
and texts created by users of these user levels.
|
||||
*/
|
||||
"rightsLevel": {"member": 2, "staff": 2, "admin": 2},
|
||||
"rightsLevel": {"member": 1, "staff": 1, "admin": 1},
|
||||
/*
|
||||
"rightsLevels" is an ordered list of rights levels, one of which will be
|
||||
assigned to each item.
|
||||
|
|
|
@ -34,10 +34,6 @@ pandora.ui.infoView = function(data) {
|
|||
return key.id;
|
||||
}),
|
||||
posterKeys = ['title', 'director', 'year'],
|
||||
descriptions = {
|
||||
names: getNames(),
|
||||
studios: getStudios()
|
||||
},
|
||||
statisticsWidth = 128,
|
||||
|
||||
$bar = Ox.Bar({size: 16})
|
||||
|
@ -215,7 +211,6 @@ pandora.ui.infoView = function(data) {
|
|||
|
||||
$links,
|
||||
|
||||
$descriptions,
|
||||
|
||||
$statistics = $('<div>')
|
||||
.css({
|
||||
|
@ -313,7 +308,7 @@ pandora.ui.infoView = function(data) {
|
|||
renderGroup(['productionCompany']);
|
||||
|
||||
renderGroup([
|
||||
'producer', 'codirector', 'writer', 'cinematographer', 'editor',
|
||||
'producer', 'writer', 'cinematographer', 'editor',
|
||||
]);
|
||||
|
||||
renderGroup(['actor']);
|
||||
|
@ -335,21 +330,12 @@ pandora.ui.infoView = function(data) {
|
|||
)
|
||||
.appendTo($text);
|
||||
|
||||
renderGroup(canSeeAllMetadata ? ['genre', 'topic'] : ['genre']);
|
||||
|
||||
|
||||
renderGroup(['imdbId', 'links']);
|
||||
renderGroup(['imdbId', 'genre']);
|
||||
|
||||
if (canEdit) {
|
||||
updateIMDb();
|
||||
}
|
||||
|
||||
// Encyclopedia and Wiki ---------------------------------------------------
|
||||
|
||||
if (['staff', 'admin'].indexOf(pandora.user.level) > -1 && canEdit) {
|
||||
renderGroup(['encyclopedia', 'wiki']);
|
||||
}
|
||||
|
||||
// Summary -----------------------------------------------------------------
|
||||
|
||||
if (data.summary || canEdit) {
|
||||
|
@ -381,12 +367,8 @@ pandora.ui.infoView = function(data) {
|
|||
.appendTo($text);
|
||||
}
|
||||
|
||||
// Descriptions ------------------------------------------------------------
|
||||
|
||||
$descriptions = $('<div>').attr({id: 'descriptions'}).appendTo($text);
|
||||
|
||||
renderDescriptions();
|
||||
|
||||
$('<div>').css({height: '16px'}).appendTo($text);
|
||||
renderGroup(['topic']);
|
||||
$('<div>').css({height: '16px'}).appendTo($text);
|
||||
|
||||
if (data.parts && data.rendered) {
|
||||
|
@ -466,7 +448,7 @@ pandora.ui.infoView = function(data) {
|
|||
var $rightsLevel = $('<div>');
|
||||
var $div = $('<div>')
|
||||
.css({marginBottom: '4px'})
|
||||
.append(formatKey('Rights Level', 'link', '/copyrights'))
|
||||
.append('Rights Level')
|
||||
.append($rightsLevel)
|
||||
.appendTo($statistics);
|
||||
pandora.createLinks($div);
|
||||
|
@ -632,11 +614,6 @@ pandora.ui.infoView = function(data) {
|
|||
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length],
|
||||
true
|
||||
) : '';
|
||||
} else if (key == 'links') {
|
||||
ret = value.split(', ').map(function(link) {
|
||||
return '<a href="' + link + '">' + Ox.parseURL(link).host + '</a>';
|
||||
}).join(', ');
|
||||
|
||||
} else if (nameKeys.indexOf(key) > -1) {
|
||||
ret = formatLink(value.split(', '), 'name');
|
||||
} else if (listKeys.indexOf(key) > -1) {
|
||||
|
@ -715,29 +692,6 @@ pandora.ui.infoView = function(data) {
|
|||
});
|
||||
}
|
||||
|
||||
function getNames() {
|
||||
var names = [];
|
||||
nameKeys.forEach(function(key) {
|
||||
data[key] && data[key].forEach(function(name) {
|
||||
var index = Ox.indexOf(names, function(value) {
|
||||
return value.name == name;
|
||||
});
|
||||
if (index == -1) {
|
||||
names.push({
|
||||
name: name,
|
||||
keys: [key],
|
||||
description: data.namedescription
|
||||
? data.namedescription[name]
|
||||
: void 0
|
||||
});
|
||||
} else {
|
||||
names[index].keys.push(key);
|
||||
}
|
||||
});
|
||||
});
|
||||
return names;
|
||||
}
|
||||
|
||||
function getRightsLevelElement(rightsLevel) {
|
||||
return Ox.Theme.formatColorLevel(
|
||||
rightsLevel,
|
||||
|
@ -747,22 +701,6 @@ pandora.ui.infoView = function(data) {
|
|||
);
|
||||
}
|
||||
|
||||
function getStudios() {
|
||||
var studios = [];
|
||||
if (data.productionCompany) {
|
||||
data.productionCompany.forEach(function(studio) {
|
||||
studios.push({
|
||||
name: studio,
|
||||
keys: ['productionCompany'],
|
||||
description: data.productionCompanydescription
|
||||
? data.productionCompanydescription[studio]
|
||||
: void 0
|
||||
});
|
||||
});
|
||||
}
|
||||
return studios;
|
||||
}
|
||||
|
||||
function getValue(key, value) {
|
||||
return !value ? ''
|
||||
: key == 'alternativeTitles' ? value.map(function(value) {
|
||||
|
@ -853,97 +791,6 @@ pandora.ui.infoView = function(data) {
|
|||
});
|
||||
}
|
||||
|
||||
function renderDescriptions() {
|
||||
$descriptions.empty();
|
||||
['studios', 'names'].forEach(function(key) {
|
||||
descriptions[key].forEach(function(value) {
|
||||
if (canEdit || value.description) {
|
||||
var filmography = key == 'studios' ? Ox._('Films') : Ox._('Filmography'),
|
||||
$name = Ox.Element()
|
||||
.addClass('OxSelectable')
|
||||
.css(css)
|
||||
.css({marginTop: '12px', fontWeight: 'bold'})
|
||||
.html(
|
||||
formatLink(
|
||||
value.name,
|
||||
key == 'studios' ? 'productionCompany' : 'name'
|
||||
) + ' (' + value.keys.map(function(key) {
|
||||
return formatKey(key, 'description');
|
||||
}).join(', ') + ') - '
|
||||
)
|
||||
.appendTo($descriptions),
|
||||
$link = $('<span>')
|
||||
.addClass('OxLink')
|
||||
.css({fontWeight: 'bold'})
|
||||
.html(Ox._('Show {0}', [filmography]))
|
||||
.one({
|
||||
click: function() {
|
||||
$link.removeClass('OxLink')
|
||||
.html(Ox._('Loading {0}...', [filmography]));
|
||||
getFilmography(
|
||||
key == 'studios' ? 'productionCompany' : 'name',
|
||||
Ox.decodeHTMLEntities(value.name),
|
||||
value.keys,
|
||||
function($element) {
|
||||
$link.addClass('OxLink')
|
||||
.html(Ox._('Hide {0}', [filmography]))
|
||||
.on({
|
||||
click: function() {
|
||||
if (Ox.startsWith($link.html(), Ox._('Show'))) {
|
||||
$link.html(Ox._('Hide {0}', [filmography]));
|
||||
$text.show();
|
||||
} else {
|
||||
$link.html(Ox._('Show {0}', [filmography]));
|
||||
$text.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
$text.append($element).show();
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.appendTo($name),
|
||||
$text = $('<div>')
|
||||
.addClass('OxSelectable')
|
||||
.css(css)
|
||||
.hide()
|
||||
.appendTo($descriptions);
|
||||
pandora.createLinks($name);
|
||||
Ox.EditableContent({
|
||||
clickLink: pandora.clickLink,
|
||||
editable: canEdit,
|
||||
format: function(value) {
|
||||
return value.replace(
|
||||
/<img /g,
|
||||
'<img style="max-width: 256px; max-height: 256px; margin: 0 16px 16px 0; float: left;" '
|
||||
);
|
||||
},
|
||||
placeholder: formatLight(Ox._('No Description')),
|
||||
tooltip: canEdit ? pandora.getEditTooltip() : '',
|
||||
type: 'textarea',
|
||||
value: value.description || ''
|
||||
})
|
||||
.css(css)
|
||||
.css({
|
||||
overflow: 'hidden'
|
||||
})
|
||||
.bindEvent({
|
||||
submit: function(data) {
|
||||
editMetadata(
|
||||
key == 'studios'
|
||||
? 'productionCompanydescription'
|
||||
: 'namedescription',
|
||||
Ox.extend({}, value.name, data.value)
|
||||
);
|
||||
}
|
||||
})
|
||||
.appendTo($descriptions);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function renderGroup(keys) {
|
||||
var $element;
|
||||
if (canEdit || keys.filter(function(key) {
|
||||
|
|
Loading…
Reference in a new issue