From 20d1119b75fdbef4feff5acb212366a8e5a299c3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 22 Sep 2012 22:00:32 +0200 Subject: [PATCH] use internationalTitle and new alternative title format: fixes #947 and #963 --- pandora/item/models.py | 4 ++-- static/js/pandora/infoView.0xdb.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 313725b9..13af1f0f 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -591,7 +591,7 @@ class Item(models.Model): i = key['id'] if i == 'title': save(i, u'\n'.join([self.get('title', 'Untitled'), - self.get('originalTitle', '')])) + self.get('internationalTitle', '')])) elif i == 'rightslevel': save(i, self.level) elif i == 'filename': @@ -834,7 +834,7 @@ class Item(models.Model): current_values = [current_values] else: current_values = [] - ot = self.get('originalTitle') + ot = self.get('internationalTitle') if ot: current_values.append(ot) elif key == 'character': diff --git a/static/js/pandora/infoView.0xdb.js b/static/js/pandora/infoView.0xdb.js index 5efdadb0..22aa2c1d 100644 --- a/static/js/pandora/infoView.0xdb.js +++ b/static/js/pandora/infoView.0xdb.js @@ -264,8 +264,8 @@ pandora.ui.infoView = function(data) { .html( formatKey('Alternative Title' + (data.alternativeTitles.length == 1 ? '' : 's')) + data.alternativeTitles.map(function(value) { - return value[0] + (value[1] ? ' ' - + formatLight('(' + value[1] + ')') : ''); + return value[0] + (Ox.isArray(value[1]) ? ' ' + + formatLight('(' + value[1].join(', ') + ')') : ''); }).join(', ') ) .appendTo($text); @@ -574,8 +574,8 @@ pandora.ui.infoView = function(data) { title = title.replace(match[0], formatLight(match[0])); } return title + ( - data.originalTitle && data.originalTitle != title - ? ' ' + formatLight('(' + data.originalTitle + ')') : '' + data.internationalTitle && data.internationalTitle != title + ? ' ' + formatLight('(' + data.internationalTitle + ')') : '' ); }