From 7b1a1eb80414947ec66b3d985410f9928ff1935a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Dec 2013 14:58:25 +0530 Subject: [PATCH] Content server: Popup a more useful error when clicking on the cover of a book that has no formats to view. Fixes #1260216 [Web content server error: 404 Not Found (The path '/browse/category/' was not found.)](https://bugs.launchpad.net/calibre/+bug/1260216) --- src/calibre/library/server/browse.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index 9141964193..f0b53baeca 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -814,7 +814,9 @@ class BrowseServer(object): (xml(href, True), rt, xml(_('Get'))) args['get_url'] = xml(href, True) else: - args['get_button'] = args['get_url'] = '' + args['get_button'] = '' + args['get_url'] = 'javascript:alert(\'%s\')' % xml(_( + 'This book has no available formats to view'), True) args['comments'] = comments_to_html(mi.comments) args['stars'] = '' if mi.rating: @@ -848,7 +850,8 @@ class BrowseServer(object): args['get_url'] = xml(self.opts.url_prefix + '/get/%s/%s_%d.%s'%( fmt, fname, id_, fmt), True) else: - args['get_url'] = '' + args['get_url'] = 'javascript:alert(\'%s\')' % xml(_( + 'This book has no available formats to view'), True) args['formats'] = '' if fmts: ofmts = [u'{3}'