|
|
@ -154,6 +154,12 @@ def show_book_by_id(id):
|
|
|
|
if id == edge:
|
|
|
|
if id == edge:
|
|
|
|
nextbook = None
|
|
|
|
nextbook = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name= book.file
|
|
|
|
|
|
|
|
annot = get_annotations()
|
|
|
|
|
|
|
|
res = get_annot_book(annot,name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userin = UserIns.query.filter_by(title="lastViewed").first()
|
|
|
|
userin = UserIns.query.filter_by(title="lastViewed").first()
|
|
|
|
if userin != None:
|
|
|
|
if userin != None:
|
|
|
|
userin.info = book.title
|
|
|
|
userin.info = book.title
|
|
|
@ -165,17 +171,10 @@ def show_book_by_id(id):
|
|
|
|
if not book:
|
|
|
|
if not book:
|
|
|
|
return render_template('red_link.html', id=id)
|
|
|
|
return render_template('red_link.html', id=id)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return render_template('show_book_detail.html', book=book, previousbook = previousbook, nextbook = nextbook, all_instances=all_instances)
|
|
|
|
return render_template('show_book_detail.html', book=book, previousbook = previousbook, nextbook = nextbook, all_instances=all_instances, name=name, annot=annot, res=res)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/books/<int:id>/annotations', methods=['POST', 'GET'])
|
|
|
|
|
|
|
|
def book_annot():
|
|
|
|
|
|
|
|
books = db.session.query(Book).all()
|
|
|
|
|
|
|
|
name=book.file
|
|
|
|
|
|
|
|
annot = get_annotations()
|
|
|
|
|
|
|
|
res = get_annot_book(annot,name)
|
|
|
|
|
|
|
|
return redirect(url_for('show_book_detail'), name=name, annot=annot, res=res, books=books)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/books/<int:id>/delete', methods=['POST', 'GET'])
|
|
|
|
@app.route('/books/<int:id>/delete', methods=['POST', 'GET'])
|
|
|
@ -593,13 +592,10 @@ def search_results(searchtype, query, viewby):
|
|
|
|
@app.route('/search_annot', methods=['POST', 'GET'])
|
|
|
|
@app.route('/search_annot', methods=['POST', 'GET'])
|
|
|
|
def search_annot():
|
|
|
|
def search_annot():
|
|
|
|
books = db.session.query(Book).all()
|
|
|
|
books = db.session.query(Book).all()
|
|
|
|
if request.method=='POST':
|
|
|
|
name=str(request.args.get('query'))
|
|
|
|
return redirect (url_for('annotations'))
|
|
|
|
annot = get_annotations()
|
|
|
|
else:
|
|
|
|
res = get_annot_results(annot,name)
|
|
|
|
name=str(request.args.get('query'))
|
|
|
|
return render_template('results_annot.html', name=name, annot=annot, res=res, books=books)
|
|
|
|
annot = get_annotations()
|
|
|
|
|
|
|
|
res = get_annot_results(annot,name)
|
|
|
|
|
|
|
|
return render_template('results_annot.html', name=name, annot=annot, res=res, books=books)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/add_to_stack/<int:id>', methods=['GET', 'POST'])
|
|
|
|
@app.route('/add_to_stack/<int:id>', methods=['GET', 'POST'])
|
|
|
|