Merge branch 'bookdetail-multiline-path' of https://github.com/un-pogaz/calibre

This commit is contained in:
Kovid Goyal 2023-05-26 20:41:44 +05:30
commit 0625df37d1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 5 deletions

View File

@ -225,12 +225,13 @@ def mi_to_html(
break break
text = _('Book files') text = _('Book files')
name = ngettext('Folder:', 'Folders:', num_of_folders) name = ngettext('Folder:', 'Folders:', num_of_folders)
link = '<a href="{}" title="{}">{}</a>{}'.format(action(scheme, book_id=book_id, loc=loc), links = ['<a href="{}" title="{}">{}</a>{}'.format(action(scheme, book_id=book_id, loc=loc),
prepare_string_for_xml(path, True), text, extra) prepare_string_for_xml(path, True), text, extra)]
if num_of_folders > 1: if num_of_folders > 1:
link += ', <a href="{}" title="{}">{}</a>'.format( links.append('<a href="{}" title="{}">{}</a>'.format(
action('data-path', book_id=book_id, loc=book_id), action('data-path', book_id=book_id, loc=book_id),
prepare_string_for_xml(data_path, True), _('Data files')) prepare_string_for_xml(data_path, True), _('Data files')))
link = value_list(', ', links)
else: else:
link = prepare_string_for_xml(path, True) link = prepare_string_for_xml(path, True)

View File

@ -483,7 +483,9 @@ class BDVerticalCats(DisplayedFields): # {{{
def initialize(self, use_defaults=False, pref_data_override=None): def initialize(self, use_defaults=False, pref_data_override=None):
fm = self.db.field_metadata fm = self.db.field_metadata
cats = [k for k in fm if fm[k]['name'] and fm[k]['is_multiple']] cats = [k for k in fm if fm[k]['name'] and fm[k]['is_multiple'] and not k.startswith('#')]
cats.append('path')
cats.extend([k for k in fm if fm[k]['name'] and fm[k]['is_multiple'] and k.startswith('#')])
ans = [] ans = []
if use_defaults: if use_defaults:
ans = [[k, False] for k in cats] ans = [[k, False] for k in cats]