@ -111,14 +111,14 @@ def annotations():
# id = book.id
# id = book.id
annot = get_annotations ( )
annot = get_annotations ( )
print ( annot )
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
# PDF from annotations
@app.route ( ' /annotations.pdf ' )
@app.route ( ' /annotations.pdf ' )
def annotations_pdf ( ) :
def annotations_pdf ( ) :
annot = get_annotations ( )
annot = get_annotations ( )
# Make a PDF straight from HTML in a string.
# 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 ) )
return render_pdf ( HTML ( string = html ) )
@app.route ( ' /viewpdf/<filename> ' )
@app.route ( ' /viewpdf/<filename> ' )
@ -136,7 +136,7 @@ def get_updates():
allbooks = db . session . query ( Book ) . all ( )
allbooks = db . session . query ( Book ) . all ( )
id = len ( allbooks )
id = len ( allbooks )
latest_upload = allbooks [ - 1 ]
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 ' ] )
@app.route ( ' /scape ' , methods = [ ' POST ' , ' GET ' ] )
def scape ( ) :
def scape ( ) :
@ -204,7 +204,7 @@ def show_book_by_id(id):
if not book :
if not book :
return render_template ( ' red_link.html ' , id = id , light = light )
return render_template ( ' red_link.html ' , id = id , light = light )
else :
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 )
@ -763,7 +763,7 @@ def import_csv():
name , file_extension = os . path . splitext ( row [ ' file ' ] )
name , file_extension = os . path . splitext ( row [ ' file ' ] )
print ( ' get_cover ' , fullpath , name )
print ( ' get_cover ' , fullpath , name )
cover = get_cover ( fullpath , name )
cover = get_cover ( fullpath , name )
file = str ( id ) + " _ " + row [ ' file ' ]
file = row [ ' file ' ]
if row [ ' year_published ' ] :
if row [ ' year_published ' ] :
year_published = int ( row [ ' year_published ' ] )
year_published = int ( row [ ' year_published ' ] )