diff --git a/app/templates/book/stat.html b/app/templates/book/stat.html new file mode 100644 index 0000000..687ccfc --- /dev/null +++ b/app/templates/book/stat.html @@ -0,0 +1,66 @@ + +{% extends 'base.html' %} +{% block content %} +
+ +

{{book.label}}

+ + + + +
+
+ + + + + + +
+{% endblock %} diff --git a/app/views/book.py b/app/views/book.py index 04a2a47..cd13157 100644 --- a/app/views/book.py +++ b/app/views/book.py @@ -147,6 +147,17 @@ def collection_view(book_id: int): ) +@bp.route("//statistics", methods=["GET"]) +def statistic_view(book_id: int): + book = db.session.get(m.Book, book_id) + if not book or book.is_deleted: + log(log.WARNING, "Book with id [%s] not found", book_id) + flash("Book not found", "danger") + return redirect(url_for("book.my_library")) + else: + return render_template("book/stat.html", book=book) + + @bp.route("///subcollections", methods=["GET"]) def sub_collection_view(book_id: int, collection_id: int): book: m.Book = db.session.get(m.Book, book_id)