From 877dd2da1d1e25bff02fd8910f901c43253078c7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Jul 2023 15:18:12 +0530 Subject: [PATCH] Content server: Allow opening the book details page for a matches book from the Full text search results page. Fixes #2025333 [Link to Book Details in FTS - Content Server](https://bugs.launchpad.net/calibre/+bug/2025333) --- src/pyj/book_list/fts.pyj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/fts.pyj b/src/pyj/book_list/fts.pyj index d806266d9c..37ad234f84 100644 --- a/src/pyj/book_list/fts.pyj +++ b/src/pyj/book_list/fts.pyj @@ -10,7 +10,7 @@ from book_list.globals import get_current_query, get_session_data from book_list.library_data import current_library_id, download_url from book_list.router import back, home, open_book_url, push_state from book_list.top_bar import create_top_bar -from book_list.ui import set_panel_handler +from book_list.ui import query_as_href, set_panel_handler from book_list.views import create_image from complete import create_search_bar from dom import add_extra_css, clear, set_css, svgicon @@ -274,7 +274,6 @@ def disable_fts(): ) - def book_result_tile_clicked(ev): result_tile = ev.currentTarget bid = int(result_tile.dataset.bookId) @@ -303,6 +302,10 @@ def book_result_tile_clicked(ev): _('Click one of the formats below to open the book at this search result (except PDF which will open at the start):'), fmc )) + parent.appendChild(E.div( + style='margin-top: 1ex', + E.a(_('Open the details page for this book'), class_='blue-link', target="_blank", href=query_as_href({'book_id':str(bid)}, 'book_details')) + )) parent.appendChild(E.div( style='margin-top: 1ex', E.a(_('Re-index this book'), class_='blue-link', href='javascript: void(0)', onclick=reindex.bind(None, bid))