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