meta. only show year

This commit is contained in:
j 2015-12-01 14:54:22 +01:00
parent adcb6bca0a
commit 70fcd5b20c
2 changed files with 11 additions and 3 deletions

View file

@ -136,6 +136,13 @@ def format(info, return_all=False):
value = value[0] value = value[0]
if key == 'publish_date': if key == 'publish_date':
value = parse_date(value) value = parse_date(value)
if key == 'publish_places':
for i, v in enumerate(value):
if v.startswith('['):
v = v[1:]
if v.endswith(']'):
v = v[:-1]
value[i] = v
data[KEYS[key]] = value data[KEYS[key]] = value
if 'subtitle' in info: if 'subtitle' in info:
data['title'] += ' ' + info['subtitle'] data['title'] += ' ' + info['subtitle']

View file

@ -113,10 +113,11 @@ oml.ui.infoView = function(identifyData) {
function formatValue(value, key) { function formatValue(value, key) {
return value ? (Ox.isArray(value) ? value : [value]).map(function(value) { return value ? (Ox.isArray(value) ? value : [value]).map(function(value) {
if (key == 'date' && value) {
value = value.slice(0, 4);
}
return key && !identifyData ? return key && !identifyData ?
'<a href="/' + key + '==' + ( '<a href="/' + key + '==' + value + '">' + value + '</a>'
key == 'date' ? value.slice(0, 4) : value
) + '">' + value + '</a>'
: value; : value;
}).join('; ') : ''; }).join('; ') : '';
} }