mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
@@ -37,7 +37,10 @@ def render_listing(request, objtype, **kwargs):
|
||||
page = paginator.page(paginator.num_pages)
|
||||
|
||||
return ajax_simple_response({
|
||||
"table" : tblclass(request, page.object_list).render(),
|
||||
"page" : page.number,
|
||||
"paginbar" : pagination_bar(page)
|
||||
})
|
||||
"table" : tblclass(request, page.object_list).render(),
|
||||
"page" : page.number,
|
||||
"paginbar" : pagination_bar(page),
|
||||
"handle_mailboxes": parameters.get_admin("HANDLE_MAILBOXES",
|
||||
raise_error=False),
|
||||
"auto_account_removal": parameters.get_admin("AUTO_ACCOUNT_REMOVAL")
|
||||
})
|
||||
|
||||
@@ -119,11 +119,17 @@ var Domains = function(options) {
|
||||
Domains.prototype = {
|
||||
list_cb: function(data) {
|
||||
Admin.prototype.list_cb.call(this, data);
|
||||
var deloptions = (data.handle_mailboxes)
|
||||
? {keepdir: gettext("Do not delete domain directory")}
|
||||
: {};
|
||||
var warnmsg = (data.auto_account_removal)
|
||||
? gettext("This operation will remove ALL data associated to this domain.")
|
||||
: gettext("This operation will remove all data associated to this domain, excepting accounts.");
|
||||
|
||||
$("a[name=deldomain]").confirm({
|
||||
question: gettext("Delete this domain?"),
|
||||
warning: gettext("This operation will remove ALL data associated to this domain."),
|
||||
checkboxes: {keepdir: gettext("Do not delete domain directory")},
|
||||
checkboxes: deloptions,
|
||||
success_cb: $.proxy(this.reload_listing, this)
|
||||
});
|
||||
},
|
||||
@@ -181,12 +187,16 @@ Identities.prototype = {
|
||||
|
||||
list_cb: function(data) {
|
||||
Admin.prototype.list_cb.call(this, data);
|
||||
var deloptions = {};
|
||||
|
||||
if (data.handle_mailboxes) {
|
||||
deloptions["checkboxes"] = {keepdir: gettext("Do not delete mailbox directory")};
|
||||
}
|
||||
$("a.filter").click($.proxy(this.filter_by_tag, this));
|
||||
|
||||
$("a[name=delaccount]").confirm({
|
||||
question: gettext("Delete this account?"),
|
||||
checkboxes: {keepdir: gettext("Do not delete mailbox directory")},
|
||||
checkboxes: deloptions,
|
||||
success_cb: $.proxy(this.reload_listing, this)
|
||||
});
|
||||
$("a[name=deldlist]").confirm({
|
||||
|
||||
@@ -310,13 +310,14 @@ def _identities(request):
|
||||
page = paginator.page(paginator.num_pages)
|
||||
|
||||
return ajax_simple_response({
|
||||
"table" : _render_to_string(request, "admin/identities_table.html", {
|
||||
"identities" : page.object_list,
|
||||
"tableid" : "objects_table"
|
||||
}),
|
||||
"page" : page.number,
|
||||
"paginbar" : pagination_bar(page)
|
||||
})
|
||||
"table" : _render_to_string(request, "admin/identities_table.html", {
|
||||
"identities" : page.object_list,
|
||||
"tableid" : "objects_table"
|
||||
}),
|
||||
"handle_mailboxes": parameters.get_admin("HANDLE_MAILBOXES", raise_error=False),
|
||||
"page" : page.number,
|
||||
"paginbar" : pagination_bar(page)
|
||||
})
|
||||
|
||||
@login_required
|
||||
@user_passes_test(lambda u: u.has_perm("auth.add_user") or u.has_perm("admin.add_alias"))
|
||||
|
||||
Reference in New Issue
Block a user