2020-02-10 17:17:05 +01:00
|
|
|
{% extends 'default.html' %}
|
|
|
|
{% set active_page = "mailbox" %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
Mailboxes
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block default_content %}
|
|
|
|
<div class="row">
|
2020-04-05 19:59:48 +02:00
|
|
|
<div class="col">
|
2020-05-03 10:47:29 +02:00
|
|
|
<h1 class="h3"> Mailboxes
|
|
|
|
<a class="ml-3 text-info" style="font-size: 12px" data-toggle="collapse" href="#howtouse" role="button"
|
|
|
|
aria-expanded="false" aria-controls="collapseExample">
|
|
|
|
How to use <i class="fe fe-chevrons-down"></i>
|
|
|
|
</a>
|
|
|
|
</h1>
|
2020-02-10 17:17:05 +01:00
|
|
|
|
|
|
|
{% if not current_user.is_premium() %}
|
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
This feature is only available in premium plan.
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2021-04-06 18:10:32 +02:00
|
|
|
<div class="alert alert-primary collapse {% if mailboxes|length == 1 %} show {% endif %}" id="howtouse" role="alert">
|
2020-02-10 17:17:05 +01:00
|
|
|
A <em>mailbox</em> is just another personal email address. When creating a new alias, you could choose the
|
|
|
|
mailbox that <em>owns</em> this alias, i.e: <br>
|
|
|
|
- all emails sent to this alias will be forwarded to this mailbox <br>
|
2020-02-23 08:08:55 +01:00
|
|
|
- from this mailbox, you can reply/send emails from the alias. <br><br>
|
2020-02-10 17:17:05 +01:00
|
|
|
|
2020-02-28 18:03:35 +01:00
|
|
|
When you signed up, a mailbox is automatically created with your email <b>{{ current_user.email }}</b>
|
|
|
|
<br><br>
|
2020-02-10 17:17:05 +01:00
|
|
|
|
|
|
|
The mailbox doesn't have to be your email: it can be your friend's email
|
2020-02-23 08:08:55 +01:00
|
|
|
if you want to create aliases for your buddy.
|
2020-02-10 17:17:05 +01:00
|
|
|
</div>
|
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
<div class="row">
|
|
|
|
{% for mailbox in mailboxes %}
|
|
|
|
<div class="col-12 col-lg-6">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title">
|
|
|
|
{{ mailbox.email }}
|
|
|
|
{% if mailbox.verified %}
|
|
|
|
<span class="cursor" data-toggle="tooltip" data-original-title="Mailbox Verified">✅</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="cursor" data-toggle="tooltip" data-original-title="Mailbox Not Verified">
|
2020-02-10 17:17:05 +01:00
|
|
|
🚫
|
|
|
|
</span>
|
2020-05-03 10:48:21 +02:00
|
|
|
{% endif %}
|
2020-11-24 11:18:16 +01:00
|
|
|
{% if mailbox.pgp_enabled() %}
|
2020-05-03 10:48:21 +02:00
|
|
|
<span class="cursor" data-toggle="tooltip" data-original-title="PGP Enabled">🗝</span>
|
|
|
|
{% endif %}
|
2020-02-23 09:41:53 +01:00
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
{% if mailbox.id == current_user.default_mailbox_id %}
|
|
|
|
<div class="badge badge-primary float-right" data-toggle="tooltip"
|
|
|
|
title="When a new random alias is created, it belongs to the default mailbox">Default Mailbox
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</h5>
|
2020-02-23 09:41:53 +01:00
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
<h6 class="card-subtitle mb-2 text-muted">
|
|
|
|
Created {{ mailbox.created_at | dt }} <br>
|
|
|
|
<span class="font-weight-bold">{{ mailbox.nb_alias() }}</span> aliases. <br>
|
2020-02-23 08:08:55 +01:00
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
</h6>
|
2020-02-10 17:17:05 +01:00
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
<a href="{{ url_for('dashboard.mailbox_detail_route', mailbox_id=mailbox.id) }}">Edit ➡</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-footer p-0">
|
|
|
|
<div class="row">
|
|
|
|
{% if mailbox.verified %}
|
|
|
|
<div class="col">
|
|
|
|
<form method="post">
|
|
|
|
<input type="hidden" name="form-name" value="set-default">
|
|
|
|
<input type="hidden" class="mailbox" value="{{ mailbox.email }}">
|
|
|
|
<input type="hidden" name="mailbox-id" value="{{ mailbox.id }}">
|
|
|
|
<button class="card-link btn btn-link
|
2020-02-23 09:51:26 +01:00
|
|
|
{% if mailbox.id == current_user.default_mailbox_id %} disabled {% endif %}"
|
2020-05-03 10:48:21 +02:00
|
|
|
>
|
|
|
|
Set As Default Mailbox
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="col">
|
|
|
|
<form method="post">
|
|
|
|
<input type="hidden" name="form-name" value="delete">
|
|
|
|
<input type="hidden" class="mailbox" value="{{ mailbox.email }}">
|
|
|
|
<input type="hidden" name="mailbox-id" value="{{ mailbox.id }}">
|
|
|
|
<span class="card-link btn btn-link text-danger float-right delete-mailbox
|
2020-02-23 09:41:53 +01:00
|
|
|
{% if mailbox.id == current_user.default_mailbox_id %} disabled {% endif %}">
|
2020-02-10 17:17:05 +01:00
|
|
|
Delete
|
|
|
|
</span>
|
2020-05-03 10:48:21 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-02-10 17:17:05 +01:00
|
|
|
</div>
|
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
</div>
|
2020-02-10 17:17:05 +01:00
|
|
|
</div>
|
2020-05-03 10:48:21 +02:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2020-02-10 17:17:05 +01:00
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
<form method="post" class="mt-2">
|
2020-02-10 17:17:05 +01:00
|
|
|
{{ new_mailbox_form.csrf_token }}
|
|
|
|
<input type="hidden" name="form-name" value="create">
|
|
|
|
|
2020-05-03 10:48:21 +02:00
|
|
|
<h2 class="h4">New Mailbox</h2>
|
2020-02-10 17:17:05 +01:00
|
|
|
|
2020-02-23 09:10:59 +01:00
|
|
|
{{ new_mailbox_form.email(class="form-control", placeholder="email@example.com") }}
|
2020-02-10 17:17:05 +01:00
|
|
|
{{ render_field_errors(new_mailbox_form.email) }}
|
2021-10-19 17:38:29 +02:00
|
|
|
<div class="small-text">
|
2021-03-18 10:59:45 +01:00
|
|
|
A mailbox can't be a disposable or forwarding email address.
|
2020-05-03 10:48:21 +02:00
|
|
|
</div>
|
|
|
|
|
2021-05-25 18:30:14 +02:00
|
|
|
<button class="btn btn-primary mt-2">Create</button>
|
2020-02-10 17:17:05 +01:00
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block script %}
|
|
|
|
<script>
|
|
|
|
$(".delete-mailbox").on("click", function (e) {
|
|
|
|
let mailbox = $(this).parent().find(".mailbox").val();
|
2020-04-30 22:37:39 +02:00
|
|
|
|
|
|
|
let that = $(this);
|
|
|
|
let message = `All aliases owned by this mailbox <b>${mailbox}</b> will be also deleted, ` +
|
2020-05-03 10:48:21 +02:00
|
|
|
" please confirm.";
|
2020-04-30 22:37:39 +02:00
|
|
|
|
|
|
|
bootbox.confirm({
|
|
|
|
message: message,
|
|
|
|
buttons: {
|
|
|
|
confirm: {
|
|
|
|
label: 'Yes, delete it',
|
|
|
|
className: 'btn-danger'
|
|
|
|
},
|
|
|
|
cancel: {
|
|
|
|
label: 'Cancel',
|
|
|
|
className: 'btn-outline-primary'
|
|
|
|
}
|
2020-02-10 17:17:05 +01:00
|
|
|
},
|
2020-04-30 22:37:39 +02:00
|
|
|
callback: function (result) {
|
|
|
|
if (result) {
|
|
|
|
that.closest("form").submit();
|
|
|
|
}
|
2020-02-10 17:17:05 +01:00
|
|
|
}
|
2020-04-30 22:37:39 +02:00
|
|
|
})
|
2020-02-10 17:17:05 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|