mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Bug 1381323: composite columns aren't links in book details
This commit is contained in:
parent
dd1df1cf4f
commit
845cfce360
@ -92,13 +92,25 @@ def mi_to_html(mi, field_list=None, default_author_link=None, use_roman_numbers=
|
||||
u'<td class="title">%s</td><td class="rating value" '
|
||||
'style=\'font-family:"%s"\'>%s</td>'%(
|
||||
name, rating_font, u'\u2605'*int(val))))
|
||||
elif metadata['datatype'] == 'composite' and \
|
||||
metadata['display'].get('contains_html', False):
|
||||
elif metadata['datatype'] == 'composite':
|
||||
val = getattr(mi, field)
|
||||
if val:
|
||||
val = force_unicode(val)
|
||||
ans.append((field,
|
||||
row % (name, comments_to_html(val))))
|
||||
if metadata['display'].get('contains_html', False):
|
||||
ans.append((field, row % (name, comments_to_html(val))))
|
||||
else:
|
||||
if not metadata['is_multiple']:
|
||||
val = '<a href="%s" title="%s">%s</a>' % (
|
||||
search_href(field, val),
|
||||
_('Click to see books with {0}: {1}').format(metadata['name'], val), val)
|
||||
else:
|
||||
all_vals = [v.strip()
|
||||
for v in val.split(metadata['is_multiple']['list_to_ui']) if v.strip()]
|
||||
links = ['<a href="%s" title="%s">%s</a>' % (
|
||||
search_href(field, x), _('Click to see books with {0}: {1}').format(
|
||||
metadata['name'], a(x)), p(x)) for x in all_vals]
|
||||
val = metadata['is_multiple']['list_to_ui'].join(links)
|
||||
ans.append((field, row % (name, val)))
|
||||
elif field == 'path':
|
||||
if mi.path:
|
||||
path = force_unicode(mi.path, filesystem_encoding)
|
||||
|
Loading…
x
Reference in New Issue
Block a user