From e785cdb937e68630c4ea25f9d1b6e47d7569e835 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 27 Feb 2013 08:58:44 +0530 Subject: [PATCH] update indiancinema info view and config --- pandora/config.indiancinema.jsonc | 4 ++-- static/js/pandora/infoView.indiancinema.js | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pandora/config.indiancinema.jsonc b/pandora/config.indiancinema.jsonc index 2e81caeb..e373e0b0 100644 --- a/pandora/config.indiancinema.jsonc +++ b/pandora/config.indiancinema.jsonc @@ -15,7 +15,7 @@ "cantPlay": { "icon": "NoCopyright", "link": "/rights", - "text": "This film is not out of copyright yet, come back in 60 years" + "text": "This movie is still under copyright." }, /* Capabilities are per user level. @@ -41,7 +41,7 @@ "canManagePlacesAndEvents": {"student": true, "staff": true, "admin": true}, "canManageTitlesAndNames": {"student": true, "staff": true, "admin": true}, "canManageUsers": {"staff": true, "admin": true}, - "canPlayClips": {"guest": 1, "member": 1, "student": 3, "staff": 3, "admin": 3}, + "canPlayClips": {"guest": 3, "member": 3, "student": 3, "staff": 3, "admin": 3}, "canPlayVideo": {"guest": 1, "member": 1, "student": 3, "staff": 3, "admin": 3}, "canRemoveItems": {"staff": true, "admin": true}, "canSeeAccessed": {"student": true, "staff": true, "admin": true}, diff --git a/static/js/pandora/infoView.indiancinema.js b/static/js/pandora/infoView.indiancinema.js index eef38186..318ae607 100644 --- a/static/js/pandora/infoView.indiancinema.js +++ b/static/js/pandora/infoView.indiancinema.js @@ -403,9 +403,13 @@ pandora.ui.infoView = function(data) { if (key == 'title') { Ox.extend(edit, parseTitle(value)); } else if (key == 'alternativeTitles') { - edit[key] = value ? value.split(', ').map(function(value) { + edit[key] = value ? value.split('; ').map(function(value) { return [value, []]; }) : []; + } else if (key == 'year') { + edit[key] = value ? parseInt(value) : ''; + } else if (key == 'runtime') { + edit[key] = value ? parseInt(value) * 60 : ''; } else if (listKeys.indexOf(key) > -1) { edit[key] = value ? value.split(', ') : []; } else { @@ -498,9 +502,7 @@ pandora.ui.infoView = function(data) { function formatValue(key, value) { var ret; - if (key == 'runtime') { - ret = Math.round(data[key] / 60) + ' min'; - } else if (key == 'imdbId') { + if (key == 'imdbId') { ret = '' + value + ''; } else if (nameKeys.indexOf(key) > -1) { @@ -555,7 +557,8 @@ pandora.ui.infoView = function(data) { return !value ? '' : key == 'alternativeTitles' ? value.map(function(value) { return value[0]; - }).join(', ') + }).join('; ') + : key == 'runtime' ? Math.round(value / 60) : Ox.contains(listKeys, key) ? value.join(', ') : value; } @@ -716,6 +719,9 @@ pandora.ui.infoView = function(data) { } }) .appendTo($element); + if (key == 'runtime') { + $('').html(' min').appendTo($element); + } } }); $element.appendTo($text);