Fix #1960227 [[Enhancement - Content server] Don't display arrows on the cover on the Book details page if there are no previous/next book](https://bugs.launchpad.net/calibre/+bug/1960227)

This commit is contained in:
Kovid Goyal 2022-02-07 18:28:15 +05:30
parent 22aaea6073
commit d5201ff24d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -513,12 +513,17 @@ def render_book(container_id, book_id):
button_style += 'display: none;'
def prev_next_button(is_prev):
delta = -1 if is_prev else 1
nbid = book_after(book_id, delta)
s = button_style
if not nbid or nbid is book_id:
s += '; display: none'
return E.div(
style=button_style,
style=s,
title=_('Previous book [Ctrl+Left]') if is_prev else _('Next book [Ctrl+Right]'),
class_='next-book-button',
svgicon('chevron-left' if is_prev else 'chevron-right'),
onclick=next_book.bind(None, book_id, (-1 if is_prev else 1))
onclick=next_book.bind(None, book_id, delta)
)
imgdiv = E.div(style='position: relative',