meta. only show year
This commit is contained in:
parent
adcb6bca0a
commit
70fcd5b20c
2 changed files with 11 additions and 3 deletions
|
@ -136,6 +136,13 @@ def format(info, return_all=False):
|
|||
value = value[0]
|
||||
if key == 'publish_date':
|
||||
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
|
||||
if 'subtitle' in info:
|
||||
data['title'] += ' ' + info['subtitle']
|
||||
|
|
|
@ -113,10 +113,11 @@ oml.ui.infoView = function(identifyData) {
|
|||
|
||||
function formatValue(value, key) {
|
||||
return value ? (Ox.isArray(value) ? value : [value]).map(function(value) {
|
||||
if (key == 'date' && value) {
|
||||
value = value.slice(0, 4);
|
||||
}
|
||||
return key && !identifyData ?
|
||||
'<a href="/' + key + '==' + (
|
||||
key == 'date' ? value.slice(0, 4) : value
|
||||
) + '">' + value + '</a>'
|
||||
'<a href="/' + key + '==' + value + '">' + value + '</a>'
|
||||
: value;
|
||||
}).join('; ') : '';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue