|
|
|
@ -113,14 +113,14 @@ def annotations():
|
|
|
|
|
rstr=('http://' + server+'/uploads/','')
|
|
|
|
|
annot = get_annotations()
|
|
|
|
|
print(annot)
|
|
|
|
|
return render_template('annotations.html', annot=annot, books=books)
|
|
|
|
|
return render_template('annotations.html', annot=annot, books=books, light=light)
|
|
|
|
|
|
|
|
|
|
# PDF from annotations
|
|
|
|
|
@app.route('/annotations.pdf')
|
|
|
|
|
def annotations_pdf():
|
|
|
|
|
annot = get_annotations()
|
|
|
|
|
# Make a PDF straight from HTML in a string.
|
|
|
|
|
html = render_template(('annotations.html'), annot=annot)
|
|
|
|
|
html = render_template(('annotations.html'), annot=annot, light=light)
|
|
|
|
|
return render_pdf(HTML(string=html))
|
|
|
|
|
|
|
|
|
|
@app.route('/myannotations.pdf')
|
|
|
|
@ -149,7 +149,7 @@ def get_updates():
|
|
|
|
|
allbooks = db.session.query(Book).all()
|
|
|
|
|
id = len(allbooks)
|
|
|
|
|
latest_upload = allbooks[-1]
|
|
|
|
|
return "This is the XPPL ~ Library XPUB ~ Updates / / / / / / / Last viewed: " + userin.info + " / / / / / / / " + str(len(allbooks)) + " Books online "+ " / / / / / / / " + "Latest upload: " + latest_upload.title
|
|
|
|
|
return "This is the XPPL ~ Library XPUB ~ Updates / / / / / / / Last viewed: " + userin.info + " / / / / / / / " + str(len(allbooks)) + " Books online "+ " / / / / / / / " + "Latest entry: " + latest_upload.title
|
|
|
|
|
|
|
|
|
|
@app.route('/scape', methods=['POST', 'GET'])
|
|
|
|
|
def scape():
|
|
|
|
@ -217,7 +217,7 @@ def show_book_by_id(id):
|
|
|
|
|
if not book:
|
|
|
|
|
return render_template('red_link.html', id=id, light=light)
|
|
|
|
|
else:
|
|
|
|
|
return render_template('show_book_detail.html', book=book, previousbook = previousbook, nextbook = nextbook, all_instances=all_instances, name=name, annot=annot, res=res)
|
|
|
|
|
return render_template('show_book_detail.html', book=book, previousbook = previousbook, nextbook = nextbook, all_instances=all_instances, name=name, annot=annot, res=res, light=light)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -776,7 +776,7 @@ def import_csv():
|
|
|
|
|
name, file_extension = os.path.splitext(row['file'])
|
|
|
|
|
print ('get_cover', fullpath, name)
|
|
|
|
|
cover = get_cover(fullpath, name)
|
|
|
|
|
file = str(id) + "_" + row['file']
|
|
|
|
|
file = row['file']
|
|
|
|
|
|
|
|
|
|
if row['year_published']:
|
|
|
|
|
year_published = int(row['year_published'])
|
|
|
|
|