Show book details in modal dialog

With them shown in a modal, you don't lose your place in the pagination. If the request comes via Ajax, the minimal layout is used. If via a normal request, the full layout is used. That lets you open the details in a new tab and have the full experience, but if you're clicking through the results of a search, you can view many without losing your place.
This commit is contained in:
Jonathan Rehm
2017-07-08 09:15:40 -07:00
parent 93dfb96174
commit 675e8dd5cd
9 changed files with 41 additions and 7 deletions
+6 -1
View File
@@ -411,6 +411,11 @@ def timestamptodate(date, fmt=None):
return native.strftime(time_format)
@app.template_filter('yesno')
def yesno(str, yes, no):
return yes if str else no
def admin_required(f):
"""
Checks if current_user.role == 1
@@ -1233,7 +1238,7 @@ def show_book(book_id):
else:
have_read = None
return render_title_template('detail.html', entry=entries, cc=cc,
return render_title_template('detail.html', entry=entries, cc=cc, is_xhr=request.is_xhr,
title=entries.title, books_shelfs=book_in_shelfs, have_read=have_read)
else:
flash(_(u"Error opening eBook. File does not exist or file is not accessible:"), category="error")