mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-28 06:28:43 +01:00
see #55: folders manipulation. Work in progress.
This commit adds the following features: * Folder creation, * Folder modification, * Folder removal. There are still issues with subfolders but they should not be too complicated to fix. I've also done some javascript refactoring.
This commit is contained in:
+7
-5
@@ -74,7 +74,7 @@ def getctx(status, level=1, callback=None, **kwargs):
|
||||
ctx[kw] = v
|
||||
return ctx
|
||||
|
||||
def ajax_response(request, status="ok", url=None, template=None, **kwargs):
|
||||
def ajax_response(request, status="ok", url="", ajaxnav=False, template=None, **kwargs):
|
||||
"""Ajax response shortcut
|
||||
|
||||
Simple shortcut that sends an JSON response. If a template is
|
||||
@@ -94,10 +94,12 @@ def ajax_response(request, status="ok", url=None, template=None, **kwargs):
|
||||
content = _render_to_string(request, template, ctx)
|
||||
else:
|
||||
content = ""
|
||||
return HttpResponse(simplejson.dumps({"status" : status,
|
||||
"content" : content,
|
||||
"url" : url}),
|
||||
mimetype="application/json")
|
||||
jsonctx = {"status" : status, "content" : content}
|
||||
if ajaxnav:
|
||||
jsonctx["ajaxnav"] = True
|
||||
else:
|
||||
jsonctx["url"] = url
|
||||
return HttpResponse(simplejson.dumps(jsonctx), mimetype="application/json")
|
||||
|
||||
def decode(s, encodings=('utf8', 'latin1', 'windows-1252', 'ascii'), charset=None):
|
||||
if charset is not None:
|
||||
|
||||
Reference in New Issue
Block a user