From 7d9f51cd9e2e173a2d7d8ebcf96f7ed15a14272a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 Mar 2019 10:15:56 +0530 Subject: [PATCH] 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) --- src/pyj/book_list/book_details.pyj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index ec63f7e455..1b51da18c1 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -436,11 +436,12 @@ def render_book(container_id, book_id): render_book.title = metadata.title set_title(c, metadata.title) 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( E.img( 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