mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 12:21:30 +02:00
show a different message for custom domain alias when deleting
This commit is contained in:
parent
8b234b63a5
commit
f0fb5108f9
@ -432,6 +432,9 @@
|
||||
|
||||
<span class="btn btn-link btn-sm float-right text-danger"
|
||||
onclick="confirmDeleteAlias.call(this)"
|
||||
{% if alias.custom_domain %}
|
||||
data-custom-domain-trash-url="{{ alias.custom_domain.get_trash_url() }}"
|
||||
{% endif %}
|
||||
data-alias="{{ alias.id }}"
|
||||
data-alias-email="{{ alias.email }}"
|
||||
>
|
||||
|
@ -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"<Custom Domain {self.domain}>"
|
||||
|
||||
|
@ -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 <b>can't</b> be restored.`;
|
||||
if (aliasDomainTrashUrl !== undefined) {
|
||||
message = `Maybe you want to disable the alias instead? When it's deleted, it's moved to the domain
|
||||
<a href="${aliasDomainTrashUrl}">trash</a>`;
|
||||
}
|
||||
|
||||
bootbox.dialog({
|
||||
title: `Delete ${alias}`,
|
||||
message: `Maybe you want to disable the alias instead? Please note once deleted, it <b>can't</b> be restored.`,
|
||||
message: message,
|
||||
size: 'large',
|
||||
onEscape: true,
|
||||
backdrop: true,
|
||||
|
Loading…
Reference in New Issue
Block a user