From 5b2f202a2c7946199045977bd1dc3c94ed4b84b0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 May 2017 16:20:07 +0530 Subject: [PATCH] Dont show ids that have no urls in the book details view. Follows behavior of book details panel in the GUI --- src/pyj/book_list/book_details.pyj | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index a790412faa..b9092a266d 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -172,12 +172,10 @@ def render_metadata(mi, table, book_id, field_list=None): # {{{ for k in keys: idval = val[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])) - else: - td.appendChild(E.span(k, ':', idval)) - if k is not keys[-1]: - td.appendChild(document.createTextNode(', ')) def process_languages(field, fm, name, val): if val and val.length: