From d1b533848ded04501b98188112548ac973c502b2 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Fri, 5 Jun 2020 20:13:39 +0200 Subject: [PATCH] Changed pubdate to timestamp --- cps/web.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cps/web.py b/cps/web.py index 3bc8763a..f88cdaa4 100644 --- a/cps/web.py +++ b/cps/web.py @@ -834,8 +834,27 @@ def render_language_books(page, name, order): @web.route("/table") @login_required_if_no_ano def books_table(): - return render_title_template('index.html', random=random, entries=entries, pagination=pagination, id=name, - title=_(u"Language: %(name)s", name=lang_name), page="language") + return render_title_template('book_table.html', title=_(u"Books list"), page="table") + +@web.route("/ajax/listbooks") +@login_required_if_no_ano +def list_books(): + order = [db.Books.timestamp.desc()] + entries, __, __ = calibre_db.fill_indexpage(1, db.Books, True, order) + js_list = json.dumps(entries, cls=db.AlchemyEncoder) + response = make_response(js_list) + response.headers["Content-Type"] = "application/json; charset=utf-8" + return response + +@web.route("/ajax/editbooks") +@login_required_if_no_ano +def edit_list_book(): + pass + +@web.route("/ajax/editbooks") +@login_required_if_no_ano +def delete_list_book(): + pass @web.route("/author") @login_required_if_no_ano