mail-account-admin/templates/account_create.html.twig

100 lines
3.9 KiB
Twig

{% extends "base.html.twig" %}
{% block title %}Create account{% endblock %}
{% block content %}
<h2>Accounts</h2>
<p>
<b>Actions:</b>
<a href="/accounts">List accounts</a> |
<span>Create account</span>
</p>
<h3>Create new account</h3>
<form action="/accounts/new" method="POST">
{{ include('includes/form_result_box.html.twig') }}
<div class="form_box">
<h4>Username</h4>
<p>
This is the primary mail address of the account and the username to use for login.
The domain is part of the username (e.g. "user@example.com").
</p>
<details>
<summary>Show list of known domains</summary>
<p class="monospace">{{ domainList ? domainList | join(', ') : 'No domains exist yet.' }}</p>
</details>
<table>
<tr>
<td><label for="create_username">Username:</label></td>
<td><input id="create_username" name="username" value="{{ formData['username'] | default('') }}"/></td>
</tr>
</table>
</div>
<div class="form_box">
<h4>Password</h4>
<p>The password will be hashed using the current default hash algorithm.</p>
<p>Leave blank to generate a random password.</p>
<table>
<tr>
<td><label for="create_password">New password:</label></td>
<td><input type="password" id="create_password" name="password" value="{{ formData['password'] | default('') }}"/></td>
</tr>
<tr>
<td><label for="create_password_repeat">Repeat password:</label></td>
<td><input type="password" id="create_password_repeat" name="password_repeat" value="{{ formData['password_repeat'] | default('') }}"/></td>
</tr>
</table>
</div>
<div class="form_box">
<h4>Account status</h4>
<table>
<tr>
<td>New account status:</td>
<td>
<label>
<input type="checkbox" name="is_active" {{ formData is not defined or formData['is_active'] | default() ? 'checked' : '' }}/>
Active
</label>
</td>
</tr>
</table>
</div>
<div class="form_box">
<h4>Home directory</h4>
<p><b>Note:</b> By default the home directory will be determined automatically from the username and domain. Only change this if you know what you're doing!</p>
<table>
<tr>
<td>Default home directory:</td>
<td><span class="gray">/srv/vmail/</span><samp>&lt;domain.tld&gt;</samp>/<samp>&lt;local_part&gt;</samp></td>
</tr>
<tr>
<td><label for="create_home_dir">Set custom home directory:</label></td>
<td>
<span class="gray">/srv/vmail/</span><input id="create_home_dir" name="home_dir" value="{{ formData['home_dir'] | default('') }}"/>
</td>
</tr>
</table>
</div>
<div class="form_box">
<h4><label for="create_memo">Admin memo</label></h4>
<p>This field is only readable by admins.</p>
<table>
<tr>
<td><label for="create_memo">Admin memo:</label></td>
<td><textarea id="create_memo" name="memo" style="min-width: 40em;">{{ formData['memo'] | default('') }}</textarea></td>
</tr>
</table>
</div>
<button type="submit">Create account</button>
<button type="reset">Reset form</button>
</form>
{% endblock %}