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:
+6
-1
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user