indiancinema info view: add encyclopedia and wiki links

This commit is contained in:
rolux 2013-03-03 10:08:53 +05:30
parent 5467c4ecff
commit d4074629d9

View file

@ -131,6 +131,8 @@ pandora.ui.infoView = function(data) {
$imdb, $imdb,
$links,
$descriptions, $descriptions,
$statistics = $('<div>') $statistics = $('<div>')
@ -235,6 +237,31 @@ pandora.ui.infoView = function(data) {
updateIMDb(); updateIMDb();
} }
// Encyclopedia and Wiki ---------------------------------------------------
if ((data.encyclopedia || data.wiki) && canEdit) {
$links = Ox.Element().css(css);
if (data.encyclopedia) {
$links
.append(formatKey('encyclopedia'))
.append(
'<a href="/texts/indiancine.ma:Encyclopedia%20of%20Indian%20Cinema/'
+ (data.encyclopedia == 'Summary' ? '240' : '570') + '">'
+ data.encyclopedia + '</a>'
)
.append(data.wiki ? '; ' : '');
}
if (data.wiki) {
$links
.append(formatKey('wiki'))
.append(
'<a href="' + data.wiki + '">' + decodeURI(data.wiki) + '</a>'
);
}
$links.appendTo($text);
pandora.createLinks($links);
}
// Summary ----------------------------------------------------------------- // Summary -----------------------------------------------------------------
if (data.summary || canEdit) { if (data.summary || canEdit) {
@ -375,7 +402,19 @@ pandora.ui.infoView = function(data) {
$('<div>') $('<div>')
.css({marginBottom: '4px'}) .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( .append(
Ox.EditableContent({ Ox.EditableContent({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
@ -472,7 +511,7 @@ pandora.ui.infoView = function(data) {
? '<span style="font-weight: bold">' + Ox.toTitleCase(key) + ':</span> ' ? '<span style="font-weight: bold">' + Ox.toTitleCase(key) + ':</span> '
: mode == 'description' : mode == 'description'
? Ox.toTitleCase(key) ? Ox.toTitleCase(key)
: $('<div>') : Ox.Element()
.css({marginBottom: '4px', fontWeight: 'bold'}) .css({marginBottom: '4px', fontWeight: 'bold'})
.html(Ox.toTitleCase(key) .html(Ox.toTitleCase(key)
.replace(' Per ', ' per ')); .replace(' Per ', ' per '));