From d4074629d9cc66fce6e4a6279fa861ea1e95c434 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 3 Mar 2013 10:08:53 +0530 Subject: [PATCH] indiancinema info view: add encyclopedia and wiki links --- static/js/pandora/infoView.indiancinema.js | 43 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/infoView.indiancinema.js b/static/js/pandora/infoView.indiancinema.js index a35e7e4fa..1585ce8de 100644 --- a/static/js/pandora/infoView.indiancinema.js +++ b/static/js/pandora/infoView.indiancinema.js @@ -131,6 +131,8 @@ pandora.ui.infoView = function(data) { $imdb, + $links, + $descriptions, $statistics = $('
') @@ -235,6 +237,31 @@ pandora.ui.infoView = function(data) { updateIMDb(); } + // Encyclopedia and Wiki --------------------------------------------------- + + if ((data.encyclopedia || data.wiki) && canEdit) { + $links = Ox.Element().css(css); + if (data.encyclopedia) { + $links + .append(formatKey('encyclopedia')) + .append( + '' + + data.encyclopedia + '' + ) + .append(data.wiki ? '; ' : ''); + } + if (data.wiki) { + $links + .append(formatKey('wiki')) + .append( + '' + decodeURI(data.wiki) + '' + ); + } + $links.appendTo($text); + pandora.createLinks($links); + } + // Summary ----------------------------------------------------------------- if (data.summary || canEdit) { @@ -375,7 +402,19 @@ pandora.ui.infoView = function(data) { $('
') .css({marginBottom: '4px'}) - .append(formatKey('Notes', 'statistics')) + .append( + formatKey('Notes', 'statistics').options({ + tooltip: 'Only ' + + Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) { + return ( + i == 0 ? '' + : i < pandora.site.capabilities.canEditMetadata.length - 1 ? ', ' + : ' and ' + ) + Ox.toTitleCase(level) + }) + + ' can see and edit these notes' + }) + ) .append( Ox.EditableContent({ clickLink: pandora.clickLink, @@ -472,7 +511,7 @@ pandora.ui.infoView = function(data) { ? '' + Ox.toTitleCase(key) + ': ' : mode == 'description' ? Ox.toTitleCase(key) - : $('
') + : Ox.Element() .css({marginBottom: '4px', fontWeight: 'bold'}) .html(Ox.toTitleCase(key) .replace(' Per ', ' per '));