Adapting messages to running configuration.

see #389
This commit is contained in:
Antoine Nguyen
2013-04-08 09:51:35 +02:00
parent 320ab88991
commit f8f07a4066
3 changed files with 27 additions and 13 deletions
+7 -4
View File
@@ -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")
})
+12 -2
View File
@@ -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({
+8 -7
View File
@@ -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"))