Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
78071841
Commit
78071841
authored
Apr 07, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
After Deleting a book the list page is still displayed #1938
parent
fac23222
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
editbooks.py
cps/editbooks.py
+2
-2
main.js
cps/static/js/main.js
+3
-1
No files found.
cps/editbooks.py
View file @
78071841
...
...
@@ -229,14 +229,14 @@ def modify_identifiers(input_identifiers, db_identifiers, db_session):
@
editbook
.
route
(
"/ajax/delete/<int:book_id>"
)
@
login_required
def
delete_book_from_details
(
book_id
):
return
Response
(
delete_book
(
book_id
,
""
,
True
),
mimetype
=
'application/json'
)
return
Response
(
delete_book
(
book_id
,
""
,
True
),
mimetype
=
'application/json'
)
@
editbook
.
route
(
"/delete/<int:book_id>"
,
defaults
=
{
'book_format'
:
""
})
@
editbook
.
route
(
"/delete/<int:book_id>/<string:book_format>"
)
@
login_required
def
delete_book_ajax
(
book_id
,
book_format
):
return
delete_book
(
book_id
,
book_format
,
False
)
return
delete_book
(
book_id
,
book_format
,
False
)
def
delete_whole_book
(
book_id
,
book
):
...
...
cps/static/js/main.js
View file @
78071841
...
...
@@ -142,10 +142,11 @@ $("#delete_confirm").click(function() {
//get data-id attribute of the clicked element
var
deleteId
=
$
(
this
).
data
(
"delete-id"
);
var
bookFormat
=
$
(
this
).
data
(
"delete-format"
);
var
ajaxResponse
=
$
(
this
).
data
(
"ajax"
);
if
(
bookFormat
)
{
window
.
location
.
href
=
getPath
()
+
"/delete/"
+
deleteId
+
"/"
+
bookFormat
;
}
else
{
if
(
$
(
this
).
data
(
"delete-format"
)
)
{
if
(
ajaxResponse
)
{
path
=
getPath
()
+
"/ajax/delete/"
+
deleteId
;
$
.
ajax
({
method
:
"get"
,
...
...
@@ -187,6 +188,7 @@ $("#deleteModal").on("show.bs.modal", function(e) {
}
$
(
e
.
currentTarget
).
find
(
"#delete_confirm"
).
data
(
"delete-id"
,
bookId
);
$
(
e
.
currentTarget
).
find
(
"#delete_confirm"
).
data
(
"delete-format"
,
bookfomat
);
$
(
e
.
currentTarget
).
find
(
"#delete_confirm"
).
data
(
"ajax"
,
$
(
e
.
relatedTarget
).
data
(
"ajax"
));
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment