fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ticket #326: better UX in adding shelves.
[wolnelektury.git]
/
apps
/
catalogue
/
views.py
diff --git
a/apps/catalogue/views.py
b/apps/catalogue/views.py
index
de2c17b
..
5be5122
100644
(file)
--- a/
apps/catalogue/views.py
+++ b/
apps/catalogue/views.py
@@
-500,7
+500,7
@@
def book_sets(request, slug):
book.tags = new_shelves + list(book.tags.filter(~Q(category='set') | ~Q(user=request.user)))
if request.is_ajax():
book.tags = new_shelves + list(book.tags.filter(~Q(category='set') | ~Q(user=request.user)))
if request.is_ajax():
- return
HttpResponse(_('<p>Shelves were sucessfully saved.</p>')
)
+ return
JSONResponse('{"msg":"'+_("<p>Shelves were sucessfully saved.</p>")+'", "after":"close"}'
)
else:
return HttpResponseRedirect('/')
else:
else:
return HttpResponseRedirect('/')
else:
@@
-634,7
+634,7
@@
def new_set(request):
new_set = new_set_form.save(request.user)
if request.is_ajax():
new_set = new_set_form.save(request.user)
if request.is_ajax():
- return
HttpResponse(_('<p>Shelf <strong>%s</strong> was successfully created</p>') % new_set
)
+ return
JSONResponse('{"id":"%d", "name":"%s", "msg":"<p>Shelf <strong>%s</strong> was successfully created</p>"}' % (new_set.id, new_set.name, new_set)
)
else:
return HttpResponseRedirect('/')
else:
return HttpResponseRedirect('/')