From de1bc3f9af089d324037a6cfd47eaea2f3fab793 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 17 Jan 2022 17:46:57 +0100 Subject: [PATCH] Fix #2265 (add book to shelf on popup for book details) Updated testresults --- cps/helper.py | 1 - cps/opds.py | 3 - cps/static/js/details.js | 7 +- test/Calibre-Web TestSummary_Linux.html | 380 +++++++++--------------- 4 files changed, 147 insertions(+), 244 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index e8a0b7384..5cfefe50d 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -40,7 +40,6 @@ from markupsafe import escape from urllib.parse import quote - try: import unidecode use_unidecode = True diff --git a/cps/opds.py b/cps/opds.py index 92c51d1ba..8f4c59056 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -20,7 +20,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import sys import datetime from functools import wraps @@ -35,8 +34,6 @@ from .web import render_read_books from .usermanagement import load_user_from_request from flask_babel import gettext as _ -from babel import Locale as LC -from babel.core import UnknownLocaleError opds = Blueprint('opds', __name__) diff --git a/cps/static/js/details.js b/cps/static/js/details.js index 3a7def32b..f559234e2 100644 --- a/cps/static/js/details.js +++ b/cps/static/js/details.js @@ -61,8 +61,11 @@ $("#archived_cb").on("change", function() { $("#shelf-actions").on("click", "[data-shelf-action]", function (e) { e.preventDefault(); - - $.post(this.href) + $.ajax({ + url: this.href, + method:"post", + data: {csrf_token:$("input[name='csrf_token']").val()}, + }) .done(function() { var $this = $(this); switch ($this.data("shelf-action")) { diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index cf85c7cc0..6c3d98b44 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@

Calibre-Web Tests

-

Start Time: 2022-01-16 07:27:28

+

Start Time: 2022-01-16 21:58:58

-

Stop Time: 2022-01-16 11:19:00

+

Stop Time: 2022-01-17 01:49:28

-

Duration: 3h 11 min

+

Duration: 3h 10 min

@@ -411,11 +411,11 @@

Calibre-Web Tests

- + TestEbookConvertCalibre 15 - 15 - 0 + 14 + 1 0 0 @@ -479,11 +479,33 @@

Calibre-Web Tests

- +
TestEbookConvertCalibre - test_convert_parameter
- PASS + +
+ FAIL +
+ + + + @@ -1414,11 +1436,11 @@

Calibre-Web Tests

- + TestLoadMetadata 1 - 1 0 + 1 0 0 @@ -1428,21 +1450,41 @@

Calibre-Web Tests

- +
TestLoadMetadata - test_load_metadata
- PASS + +
+ FAIL +
+ + + + - + TestEditBooksOnGdrive 20 - 20 - 0 + 19 + 1 0 0 @@ -1623,11 +1665,31 @@

Calibre-Web Tests

- +
TestEditBooksOnGdrive - test_watch_metadata
- PASS + +
+ FAIL +
+ + + + @@ -1825,15 +1887,15 @@

Calibre-Web Tests

- + TestFilePicker - 1 - 1 - 0 + 3 + 2 0 0 + 1 - Detail + Detail @@ -1847,6 +1909,41 @@

Calibre-Web Tests

+ + + +
TestFilePicker - test_filepicker_new_file
+ + +
+ SKIP +
+ + + + + + + + + + +
TestFilePicker - test_two_filepickers
+ + PASS + + + @@ -3247,12 +3344,12 @@

Calibre-Web Tests

- + TestUpdater 9 - 1 - 4 - 3 + 8 + 0 + 0 1 Detail @@ -3261,214 +3358,56 @@

Calibre-Web Tests

- +
TestUpdater - test_check_update_nightly_errors
- -
- FAIL -
- - - - + PASS - +
TestUpdater - test_check_update_nightly_request_errors
- -
- FAIL -
- - - - + PASS - +
TestUpdater - test_check_update_stable_errors
- -
- FAIL -
- - - - + PASS - +
TestUpdater - test_check_update_stable_versions
- -
- FAIL -
- - - - + PASS - +
TestUpdater - test_perform_update
- -
- ERROR -
- - - - + PASS - +
TestUpdater - test_perform_update_stable_errors
- -
- ERROR -
- - - - + PASS @@ -3508,46 +3447,11 @@

Calibre-Web Tests

- +
TestUpdater - test_update_write_protect
- -
- ERROR -
- - - - + PASS @@ -4472,11 +4376,11 @@

Calibre-Web Tests

Total - 381 - 367 - 4 + 383 + 372 3 - 7 + 0 + 8   @@ -4864,7 +4768,7 @@