mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Allow clicking on book cover in details page to read the book. Fixes #1819058 [[Feature] Clicking on cover in book details to read it](https://bugs.launchpad.net/calibre/+bug/1819058)
This commit is contained in:
parent
99e8bdd227
commit
7d9f51cd9e
@ -436,11 +436,12 @@ def render_book(container_id, book_id):
|
|||||||
render_book.title = metadata.title
|
render_book.title = metadata.title
|
||||||
set_title(c, metadata.title)
|
set_title(c, metadata.title)
|
||||||
authors = metadata.authors.join(' & ') if metadata.authors else _('Unknown')
|
authors = metadata.authors.join(' & ') if metadata.authors else _('Unknown')
|
||||||
alt = _('{} by {}').format(metadata.title, authors)
|
alt = _('{} by {}\nClick to read').format(metadata.title, authors)
|
||||||
imgdiv = E.div(
|
imgdiv = E.div(
|
||||||
E.img(
|
E.img(
|
||||||
alt=alt, title=alt, data_title=metadata.title, data_authors=authors,
|
alt=alt, title=alt, data_title=metadata.title, data_authors=authors,
|
||||||
style='border-radius: 20px; max-width: calc(100vw - 2em); max-height: calc(100vh - 4ex - {}); display: block; width:auto; height:auto; border-radius: 20px'.format(get_font_size('title')
|
onclick=read_book.bind(None, book_id),
|
||||||
|
style='cursor: pointer; border-radius: 20px; max-width: calc(100vw - 2em); max-height: calc(100vh - 4ex - {}); display: block; width:auto; height:auto; border-radius: 20px'.format(get_font_size('title')
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
imgdiv.firstChild.onerror = on_img_err
|
imgdiv.firstChild.onerror = on_img_err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user