2020-07-20 16:34:35 +02:00
{% extends 'layouts/base.njk' %}
2020-11-03 12:22:52 +01:00
{% set title = app.name + ' - Account' %}
2020-07-20 16:34:35 +02:00
{% block body %}
2020-07-27 16:02:09 +02:00
<main class="container">
<div class="panel">
<i data-feather="user"></i>
2020-07-20 16:34:35 +02:00
<h1>My account</h1>
<p>Name: {{ user.name }}</p>
2020-07-27 16:02:09 +02:00
</div>
2020-07-20 16:34:35 +02:00
2020-11-10 15:05:43 +01:00
<section class="panel">
<h2><i data-feather="key"></i> Change password</h2>
<form action="{{ route('change-password') }}" method="POST">
{{ macros.field(_locals, 'password', 'current_password', null, 'Current password') }}
{{ macros.field(_locals, 'password', 'new_password', null, 'New password') }}
{{ macros.field(_locals, 'password', 'new_password_confirmation', null, 'New password confirmation') }}
<button type="submit"><i data-feather="save"></i> Save</button>
{{ macros.csrf(getCsrfToken) }}
</form>
</section>
2020-07-27 16:02:09 +02:00
<section class="panel">
<h2><i data-feather="shield"></i> Recovery email addresses</h2>
2020-07-20 16:34:35 +02:00
2020-07-27 16:02:09 +02:00
<table class="data-table">
<thead>
<tr>
<th>Type</th>
<th>Address</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for email in emails %}
{% if email.id == user.main_email_id %}
<tr>
<td>Main</td>
<td>{{ email.email }}</td>
<td></td>
</tr>
{% endif %}
{% endfor %}
{% for email in emails %}
{% if email.id != user.main_email_id %}
<tr>
<td>Secondary</td>
<td>{{ email.email }}</td>
<td class="actions">
<form action="{{ route('set-main-recovery-email') }}" method="POST">
<input type="hidden" name="id" value="{{ email.id }}">
<button class="warning"
onclick="return confirm('Are you sure you want to set {{ email.email }} as your main address?');">
2020-07-30 10:58:18 +02:00
<i data-feather="refresh-ccw"></i> <span class="tip">Set as main address</span>
2020-07-27 16:02:09 +02:00
</button>
2020-11-02 22:16:51 +01:00
{{ macros.csrf(getCsrfToken) }}
2020-07-27 16:02:09 +02:00
</form>
<form action="{{ route('remove-recovery-email') }}" method="POST">
<input type="hidden" name="id" value="{{ email.id }}">
<button class="danger"
onclick="return confirm('Are you sure you want to delete {{ email.email }}?');">
2020-07-30 10:58:18 +02:00
<i data-feather="trash"></i> <span class="tip">Remove</span>
2020-07-27 16:02:09 +02:00
</button>
2020-11-02 22:16:51 +01:00
{{ macros.csrf(getCsrfToken) }}
2020-07-27 16:02:09 +02:00
</form>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<form action="{{ route('add-recovery-email') }}" method="POST" class="sub-panel">
<h3>Add a recovery email address:</h3>
{{ macros.field(_locals, 'email', 'email', null, 'Choose a safe email address', 'An email we can use to identify you in case you lose access to your account', 'required') }}
<button><i data-feather="plus"></i> Add recovery email</button>
2020-11-02 22:16:51 +01:00
{{ macros.csrf(getCsrfToken) }}
2020-07-27 16:02:09 +02:00
</form>
</section>
<section class="panel">
<h2><i data-feather="mail"></i> Mailbox</h2>
<p class="center">{% if mailboxIdentity == null %}(Not created yet){% else %}{{ mailboxIdentity }}{% endif %}</p>
<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">
<form action="{{ route('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 }}?')">
2020-07-30 10:58:18 +02:00
<i data-feather="trash"></i> <span class="tip">Delete</span>
2020-07-27 16:02:09 +02:00
</button>
2020-11-02 22:16:51 +01:00
{{ macros.csrf(getCsrfToken) }}
2020-07-27 16:02:09 +02:00
</form>
</td>
</tr>
{% else %}
2020-07-25 18:24:12 +02:00
<tr>
2020-07-29 16:02:50 +02:00
<td colspan="3">No identity (yet).</td>
2020-07-25 18:24:12 +02:00
</tr>
2020-07-27 16:02:09 +02:00
{% endfor %}
</tbody>
</table>
<form action="{{ route('create-mail-identity') }}" method="POST" class="sub-panel">
<h3>{% if mailboxIdentity == null %}Create your 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>
<div class="hint">
<i data-feather="info"></i>
If using a "public" domain, can only be set to your username.
</div>
<button><i data-feather="plus"></i> Create</button>
2020-11-02 22:16:51 +01:00
{{ macros.csrf(getCsrfToken) }}
2020-07-27 16:02:09 +02:00
</form>
</section>
</main>
2020-11-02 22:16:51 +01:00
{% endblock %}