mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use a single iframe for all comments columns
This commit is contained in:
parent
daf89ef4bc
commit
6a0a4811a2
@ -263,16 +263,18 @@ def render_metadata(mi, table, book_id, field_list=None): # {{{
|
|||||||
print('Failed to render metadata field: ' + field)
|
print('Failed to render metadata field: ' + field)
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
all_html = ''
|
||||||
for i, field in enumerate(sorted(comments)):
|
for i, field in enumerate(sorted(comments)):
|
||||||
fm = field_metadata[field]
|
fm = field_metadata[field]
|
||||||
comment = comments[field]
|
comment = comments[field]
|
||||||
div = E.div(sandboxed_html(comment))
|
if comment:
|
||||||
if fm.display?.heading_position is 'above':
|
if fm.display?.heading_position is 'above':
|
||||||
name = fm.name or field
|
name = fm.name or field
|
||||||
div.insertBefore(E.h3(name), div.firstChild or None)
|
all_html += f'<h3>{name}</h3>'
|
||||||
table.parentNode.appendChild(div)
|
all_html += comment
|
||||||
if i is 0:
|
iframe = sandboxed_html(all_html)
|
||||||
div.style.marginTop = '2ex'
|
iframe.style.marginTop = '2ex'
|
||||||
|
table.parentNode.appendChild(iframe)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
CLASS_NAME = 'book-details-panel'
|
CLASS_NAME = 'book-details-panel'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user