Dont show ids that have no urls in the book details view. Follows behavior of book details panel in the GUI

This commit is contained in:
Kovid Goyal 2017-05-11 16:20:07 +05:30
parent edfbb3c7bc
commit 5b2f202a2c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -172,12 +172,10 @@ def render_metadata(mi, table, book_id, field_list=None): # {{{
for k in keys: for k in keys:
idval = val[k] idval = val[k]
x = url_map[k] x = url_map[k]
if isinstance(x, list) and x.length is 2: if x:
if td.childNodes.length:
td.appendChild(document.createTextNode(', '))
td.appendChild(E.a(title='{}:{}'.format(k, idval), target='_new', href=x[1], x[0])) td.appendChild(E.a(title='{}:{}'.format(k, idval), target='_new', href=x[1], x[0]))
else:
td.appendChild(E.span(k, ':', idval))
if k is not keys[-1]:
td.appendChild(document.createTextNode(', '))
def process_languages(field, fm, name, val): def process_languages(field, fm, name, val):
if val and val.length: if val and val.length: