From f689517d1a37bccdc9ffb6347d0805e7659bd58e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 19 Jan 2022 11:04:16 +0530 Subject: [PATCH] Fix #1954890 [[Feature Request] Content Server: Search results with number of items found](https://bugs.launchpad.net/calibre/+bug/1954890) --- src/pyj/book_list/views.pyj | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index 1c9b84a3b3..54f868e296 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -250,13 +250,14 @@ def show_top_message(): if q.search: container.appendChild(E.br()) if q.search: - text = _('Showing books matching: {} ') - if not library_data.search_result.total_num: - text = _('No books matching: {} ') - container.appendChild(E.span( - E.span(text.format(library_data.search_result.query)), - create_button(_('Clear'), 'close', def(): search();, _('Clear this search')) - )) + c = E.span() + if library_data.search_result.total_num: + c.appendChild(E.span(_('Showing books matching:'), ' ', E.i(library_data.search_result.query), ' ', _('(total matches: {}) ').format(library_data.search_result.total_num))) + c.appendChild(E.span(' ', E.a(_('Clear search'), class_='blue-link', onclick=def(): search();))) + else: + c.appendChild(E.span(_('No books matching:'), ' ', E.i(library_data.search_result.query))) + + container.appendChild(c) def create_books_list(container): book_list_data.container_id = ensure_id(container)