show alias in confirmation message

This commit is contained in:
Son NK 2019-12-26 17:37:51 +00:00
parent 41aee485bf
commit 65d0848e2f
1 changed files with 10 additions and 4 deletions

View File

@ -115,8 +115,10 @@
{% endif %}
style="padding-left: 0px"
>
<input type="hidden" name="alias" class="alias" value="{{ gen_email.email }}">
<input type="checkbox" class="custom-switch-input"
{{ "checked" if gen_email.enabled else "" }}>
<span class="custom-switch-indicator"></span>
</label>
</form>
@ -143,6 +145,8 @@
<form method="post">
<input type="hidden" name="form-name" value="delete-email">
<input type="hidden" name="gen-email-id" value="{{ gen_email.id }}">
<input type="hidden" name="alias" class="alias" value="{{ gen_email.email }}">
<span class="delete-email btn btn-link btn-sm float-right">
Delete&nbsp; &nbsp;<i class="dropdown-icon fe fe-trash-2"></i>
</span>
@ -248,9 +252,10 @@
$(".delete-email").on("click", function (e) {
let alias = $(this).parent().find(".alias").val();
notie.confirm({
text: "Once an alias is deleted, people/apps " +
"who used to contact you via this email address cannot reach you any more," +
text: `Once <b>${alias}</b> is deleted, people/apps ` +
"who used to contact you via this alias cannot reach you any more," +
" please confirm.",
cancelCallback: () => {
// nothing to do
@ -276,11 +281,12 @@
$(".custom-switch-input").change(function (e) {
var message = "";
let alias = $(this).parent().find(".alias").val();
if (e.target.checked) {
message = `After this, you will start receiving email sent to this alias, please confirm.`;
message = `After this, you will start receiving email sent to <b>${alias}</b>, please confirm.`;
} else {
message = `After this, you will stop receiving email sent to this alias, please confirm.`;
message = `After this, you will stop receiving email sent to <b>${alias}</b>, please confirm.`;
}
notie.confirm({