rainbox.email/views/backend/mailbox.njk

76 lines
3.3 KiB
Plaintext

{% extends 'layouts/base.njk' %}
{% set title = app.name + ' - Backend' %}
{% block body %}
<div class="container">
{{ macros.breadcrumb(mailbox.userName + ' - ' + mailbox.name, [
{title: 'Backend', link: route('backend')},
{title: 'Mailboxes', link: route('backend-mailboxes')}
]) }}
<h1>Mailbox: {{ mailbox.userName }} - {{ mailbox.name }}</h1>
<section class="panel">
<h2><i data-feather="mail"></i> Identities</h2>
<table class="data-table">
<thead>
<tr>
<th>#</th>
<th>Email</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for identity in identities %}
<tr>
<td>{{ identity.id }}</td>
<td>{{ identity.email }}</td>
<td class="actions">
{% if mailbox.name != identity.email %}
<form action="{{ route('backend-set-main-mail-identity') }}" method="POST">
<input type="hidden" name="id" value="{{ identity.id }}">
<button class=""
onclick="return confirm('Are you sure you want to set {{ identity.email }} as this mailbox\'s identity? This requires moving existing emails on the mail server afterwards.')">
<i data-feather="tag"></i> <span class="tip">Set as main identity</span>
</button>
{{ macros.csrf(getCsrfToken) }}
</form>
<form action="{{ route('backend-delete-mail-identity') }}" method="POST">
<input type="hidden" name="id" value="{{ identity.id }}">
<button class="danger"
onclick="return confirm('Are you sure you want to delete {{ identity.email }}?')">
<i data-feather="trash"></i> <span class="tip">Delete</span>
</button>
{{ macros.csrf(getCsrfToken) }}
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form action="{{ route('backend-create-mail-identity', mailbox.id) }}" method="POST" class="sub-panel">
<h3>{% if not mailbox.exists %}Create a mailbox{% else %}Create a new mail identity{% endif %}</h3>
<div class="inline-fields">
{{ macros.field(_locals, 'text', 'name', user.name, 'Email name', null, 'required') }}
<span>@</span>
{{ macros.field(_locals, 'select', 'mail_domain_id', null, 'Choose the email domain', null, 'required', domains) }}
</div>
<button><i data-feather="plus"></i> Create</button>
{{ macros.csrf(getCsrfToken) }}
</form>
</section>
</div>
{% endblock %}