diff --git a/app/dashboard/templates/dashboard/index.html b/app/dashboard/templates/dashboard/index.html index 3ecb12ce..b6cfaeb7 100644 --- a/app/dashboard/templates/dashboard/index.html +++ b/app/dashboard/templates/dashboard/index.html @@ -432,6 +432,9 @@ diff --git a/app/models.py b/app/models.py index 3807848a..ea78d970 100644 --- a/app/models.py +++ b/app/models.py @@ -1684,6 +1684,9 @@ class CustomDomain(db.Model, ModelMixin): def nb_alias(self): return Alias.filter_by(custom_domain_id=self.id).count() + def get_trash_url(self): + return URL + f"/dashboard/domains/{self.id}/trash" + def __repr__(self): return f"" diff --git a/static/js/index.js b/static/js/index.js index 7473485f..f106d9c8 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -3,10 +3,17 @@ $('.mailbox-select').multipleSelect(); function confirmDeleteAlias() { let that = $(this); let alias = that.data("alias-email"); + let aliasDomainTrashUrl = that.data("custom-domain-trash-url"); + + let message = `Maybe you want to disable the alias instead? Please note once deleted, it can't be restored.`; + if (aliasDomainTrashUrl !== undefined) { + message = `Maybe you want to disable the alias instead? When it's deleted, it's moved to the domain + trash`; + } bootbox.dialog({ title: `Delete ${alias}`, - message: `Maybe you want to disable the alias instead? Please note once deleted, it can't be restored.`, + message: message, size: 'large', onEscape: true, backdrop: true,