Files
boilerplate_rust_web/templates/admin/user_form.html
T

41 lines
1.8 KiB
HTML
Raw Normal View History

{% extends "admin/layout.html" %}
{% block admin_title %}{% if is_edit %}{{ t.users_edit_heading }}{% else %}{{ t.users_new_heading }}{% endif %}{% endblock admin_title %}
{% block content %}
<h1>{% if is_edit %}{{ t.users_edit_heading }}{% else %}{{ t.users_new_heading }}{% endif %}</h1>
<form method="post" action="{% if is_edit %}/admin/users/{{ form_user_id }}/edit{% else %}/admin/users/new{% endif %}">
<table>
<tr>
<td><label for="username">{{ t.users_username }}</label></td>
<td><input name="username" id="username" value="{{ form_username }}" required style="width:100%"></td>
</tr>
<tr>
<td><label for="email">{{ t.users_email }}</label></td>
<td><input name="email" id="email" type="email" value="{{ form_email }}" style="width:100%"></td>
</tr>
<tr>
<td><label for="display_name">{{ t.users_display_name }}</label></td>
<td><input name="display_name" id="display_name" value="{{ form_display_name }}" style="width:100%"></td>
</tr>
<tr>
<td><label for="password">{{ t.login_password }}</label></td>
<td>
<input name="password" id="password" type="password"{% if !is_edit %} required{% endif %} style="width:100%">
{% if is_edit %}<br><small style="color:#888;">{{ t.users_password_hint }}</small>{% endif %}
</td>
</tr>
<tr>
<td><label for="role">{{ t.users_role }}</label></td>
<td>
<select name="role" id="role" style="width:100%; padding:.4rem;">
<option value="user"{% if form_role == "user" %} selected{% endif %}>user</option>
<option value="admin"{% if form_role == "admin" %} selected{% endif %}>admin</option>
</select>
</td>
</tr>
</table>
<button type="submit" style="margin-top: 1rem; padding: .5rem 1.5rem;">{{ t.settings_save }}</button>
</form>
{% endblock content %}