diff --git a/static/js/documentInfoView.js b/static/js/documentInfoView.js index 9b3cd79e..c9d65fd2 100644 --- a/static/js/documentInfoView.js +++ b/static/js/documentInfoView.js @@ -28,6 +28,13 @@ pandora.ui.documentInfoView = function(data, isMixed) { }).map(function(key){ return key.id; }), + displayedKeys = [ // FIXME: can tis be a flag in the config? + 'title', 'notes', 'name', 'description', 'id', + 'user', 'rightslevel', 'timesaccessed', + 'extension', 'dimensions', 'size', 'matches', + 'created', 'modified', 'accessed', + 'random', 'entity' + ], statisticsWidth = 128, $bar = Ox.Bar({size: 16}) @@ -234,6 +241,10 @@ pandora.ui.documentInfoView = function(data, isMixed) { Ox.getObjectById(pandora.site.documentKeys, 'keywords') && renderGroup(['keywords']) + // Render any remaing keys defined in config + + renderRemainingKeys(); + // Description ------------------------------------------------------------- @@ -321,6 +332,7 @@ pandora.ui.documentInfoView = function(data, isMixed) { } + // Extension, Dimensions, Size --------------------------------------------- ['extension', 'dimensions', 'size'].forEach(function(key) { @@ -533,6 +545,7 @@ pandora.ui.documentInfoView = 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) { @@ -565,6 +578,17 @@ pandora.ui.documentInfoView = function(data, isMixed) { return $element; } + function renderRemainingKeys() { + var keys = pandora.site.documentKeys.filter(function(item) { + return item.id != '*' && !Ox.contains(displayedKeys, item.id); + }).map(function(item) { + return item.id; + }); + if (keys.length) { + renderGroup(keys) + } + } + function renderRightsLevel() { var $rightsLevelElement = getRightsLevelElement(data.rightslevel), $rightsLevelSelect;