forked from 0x2620/pandora
display any additional fields specified in config on info page
This commit is contained in:
parent
f012d99942
commit
6e10bb17d2
1 changed files with 28 additions and 2 deletions
|
@ -38,6 +38,15 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
})
|
||||
),
|
||||
posterKeys = nameKeys.concat(['title', 'year']),
|
||||
displayedKeys = [ // FIXME: can tis be a flag in the config?
|
||||
'title', 'notes', 'name', 'summary', 'id',
|
||||
'hue', 'saturation', 'lightness', 'cutsperminute', 'volume',
|
||||
'user', 'rightslevel', 'bitrate', 'timesaccessed',
|
||||
'numberoffiles', 'numberofannotations', 'numberofcuts', 'words', 'wordsperminute',
|
||||
'duration', 'aspectratio', 'pixels', 'size', 'resolution',
|
||||
'created', 'modified', 'accessed',
|
||||
'random'
|
||||
],
|
||||
statisticsWidth = 128,
|
||||
|
||||
$bar = Ox.Bar({size: 16})
|
||||
|
@ -236,14 +245,18 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
)
|
||||
.appendTo($text);
|
||||
|
||||
// Director, Year and Country ----------------------------------------------
|
||||
// Director, Year and Country, Language --------------------------------
|
||||
|
||||
renderGroup(['director', 'year', 'country']);
|
||||
renderGroup(['director', 'year', 'country', 'language']);
|
||||
|
||||
// Featuring ----------------------------------------------
|
||||
|
||||
renderGroup(['featuring']);
|
||||
|
||||
// Render any remaing keys defined in config
|
||||
|
||||
renderRemainingKeys();
|
||||
|
||||
// Summary -----------------------------------------------------------------
|
||||
|
||||
if (canEdit || data.summary) {
|
||||
|
@ -278,6 +291,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
.appendTo($text);
|
||||
}
|
||||
|
||||
|
||||
// Duration, Aspect Ratio --------------------------------------------------
|
||||
if (!isMultiple) {
|
||||
['duration', 'aspectratio'].forEach(function(key) {
|
||||
|
@ -575,6 +589,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
|
||||
function renderGroup(keys) {
|
||||
var $element;
|
||||
keys.forEach(function(key) { displayedKeys.push(key) });
|
||||
if (canEdit || keys.filter(function(key) {
|
||||
return data[key];
|
||||
}).length) {
|
||||
|
@ -606,6 +621,17 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
}
|
||||
}
|
||||
|
||||
function renderRemainingKeys() {
|
||||
var keys = pandora.site.itemKeys.filter(function(item) {
|
||||
return item.id != '*' && item.type != 'layer' && !Ox.contains(displayedKeys, item.id);
|
||||
}).map(function(item) {
|
||||
return item.id;
|
||||
});
|
||||
if (keys.length) {
|
||||
renderGroup(keys)
|
||||
}
|
||||
}
|
||||
|
||||
function renderRightsLevel() {
|
||||
var $rightsLevelElement = getRightsLevelElement(data.rightslevel),
|
||||
$rightsLevelSelect;
|
||||
|
|
Loading…
Reference in a new issue