diff --git a/cps/editbooks.py b/cps/editbooks.py index 3a08f061..30535ef3 100755 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -1212,8 +1212,11 @@ def edit_list_book(param): 'newValue': ' & '.join([author.replace('|',',') for author in input_authors])}), mimetype='application/json') elif param == 'is_archived': - change_archived_books(book.id, vals['value'] == "True") - ret = "" + is_archived = change_archived_books(book.id, vals['value'] == "True", + message="Book {} archivebit set to: {}".format(book.id, vals['value'])) + if is_archived: + kobo_sync_status.remove_synced_book(book.id) + return "" elif param == 'read_status': ret = helper.edit_book_read_status(book.id, vals['value'] == "True") if ret: diff --git a/cps/helper.py b/cps/helper.py index b0b28a99..74a8dbbb 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -335,7 +335,7 @@ def edit_book_read_status(book_id, read_status=None): except (OperationalError, InvalidRequestError) as e: calibre_db.session.rollback() log.error(u"Read status could not set: {}".format(e)) - return "Read status could not set: {}".format(e), 400 + return _("Read status could not set: {}".format(e.orig)) return "" # Deletes a book fro the local filestorage, returns True if deleting is successfull, otherwise false diff --git a/cps/static/js/details.js b/cps/static/js/details.js index 6f99595d..f0259f8c 100644 --- a/cps/static/js/details.js +++ b/cps/static/js/details.js @@ -28,14 +28,24 @@ $("#have_read_cb").on("change", function() { data: $(this).closest("form").serialize(), error: function(response) { var data = [{type:"danger", message:response.responseText}] - $("#flash_success").remove(); + // $("#flash_success").parent().remove(); $("#flash_danger").remove(); + $(".row-fluid.text-center").remove(); if (!jQuery.isEmptyObject(data)) { - data.forEach(function (item) { - $(".navbar").after('