2018-08-15 01:12:58 +00:00
|
|
|
{% extends 'manage/users/master.twig' %}
|
2018-10-22 19:53:21 +00:00
|
|
|
{% from 'macros.twig' import container_title %}
|
2018-08-15 01:12:58 +00:00
|
|
|
{% from 'manage/macros.twig' import permissions_table %}
|
2019-02-05 12:31:52 +00:00
|
|
|
{% from '_layout/input.twig' import input_csrf, input_text, input_checkbox, input_file, input_select, input_colour %}
|
2018-04-23 03:00:55 +00:00
|
|
|
|
2019-02-27 14:46:18 +00:00
|
|
|
{% set site_link = url('user-profile', {'user': manage_user.user_id}) %}
|
2018-09-25 21:21:11 +00:00
|
|
|
|
2018-08-15 17:20:41 +00:00
|
|
|
{% block manage_content %}
|
2019-02-04 21:10:00 +00:00
|
|
|
<div class="manage__user"{% if manage_user is defined %} style="{{ manage_user.user_colour|html_colour('--accent-colour') }}"{% endif %}>
|
|
|
|
{% if manage_notices|length > 0 %}
|
2018-12-01 12:35:42 +00:00
|
|
|
<div class="warning">
|
|
|
|
<div class="warning__content">
|
2019-02-04 21:10:00 +00:00
|
|
|
{% for notice in manage_notices %}
|
|
|
|
<p>{{ notice }}</p>
|
|
|
|
{% endfor %}
|
2018-12-01 12:35:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-04 21:10:00 +00:00
|
|
|
{% endif %}
|
2018-12-01 12:35:42 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
{% if can_manage_users %}
|
|
|
|
<form method="post" action="" class="container manage__user__container">
|
|
|
|
{{ container_title('Editing ' ~ manage_user.username ~ ' (' ~ manage_user.user_id ~ ')') }}
|
|
|
|
{{ input_csrf('users_edit') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<div class="manage__user__details">
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Username</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('user[username]', 'manage__user__input', manage_user.username, 'text', '', true, {'maxlength':16}) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">E-mail address</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('user[email]', 'manage__user__input', manage_user.email, 'text', '', true, {'maxlength':255}) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Title</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('user[title]', 'manage__user__input', manage_user.user_title, 'text', '', false, {'maxlength':64}) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Joined</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('', 'manage__user__input', manage_user.user_created) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Last online</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('', 'manage__user__input', manage_user.user_active) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Register IP</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('', 'manage__user__input', manage_user.register_ip_decoded) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Last IP</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('', 'manage__user__input', manage_user.last_ip_decoded) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-05-27 01:59:57 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Country</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('user[country]', 'manage__user__input', manage_user.user_country, 'text', 'XX', true, {'maxlength':2,'minlength':2}) }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-05-27 01:59:57 +00:00
|
|
|
|
2018-10-22 19:53:21 +00:00
|
|
|
|
2018-07-08 19:24:59 +00:00
|
|
|
<label class="form__label">
|
2019-02-04 21:10:00 +00:00
|
|
|
<div class="form__label__text">New Password</div>
|
2018-07-08 19:24:59 +00:00
|
|
|
<div class="form__label__input">
|
2019-02-04 21:10:00 +00:00
|
|
|
{{ input_text('password[new]', 'manage__user__input', '', 'password') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Confirm Password</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_text('password[confirm]', 'manage__user__input', '', 'password') }}
|
|
|
|
</div>
|
|
|
|
</label>
|
2018-08-15 20:29:18 +00:00
|
|
|
</div>
|
2018-10-22 19:53:21 +00:00
|
|
|
|
2019-02-04 21:10:00 +00:00
|
|
|
<div class="manage__user__details">
|
2018-07-08 19:24:59 +00:00
|
|
|
<label class="form__label">
|
2019-02-04 21:10:00 +00:00
|
|
|
<div class="form__label__text">Custom Colour</div>
|
2018-07-08 19:24:59 +00:00
|
|
|
<div class="form__label__input">
|
2019-02-04 21:10:00 +00:00
|
|
|
{{ input_checkbox('colour[enable]', '', manage_user.user_colour is not null and not manage_user.user_colour|colour_inherit) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2019-02-05 12:31:52 +00:00
|
|
|
{{ input_colour('colour[hex]', '', manage_user.user_colour|default(0)|colour_hex) }}
|
2019-02-04 21:10:00 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="manage__user__buttons">
|
|
|
|
<button class="input__button manage__user__button">Save</button>
|
|
|
|
<button class="input__button manage__user__button" type="reset">Reset</button>
|
2018-08-15 20:29:18 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2019-02-04 21:10:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
{% if can_manage_perms %}
|
|
|
|
<form method="post" action="" class="container manage__user__container">
|
|
|
|
{{ container_title('Permissions for ' ~ manage_user.username ~ ' (' ~ manage_user.user_id ~ ')') }}
|
|
|
|
{{ input_csrf('users_edit') }}
|
|
|
|
|
|
|
|
{{ permissions_table(permissions, true) }}
|
|
|
|
|
|
|
|
<div class="manage__user__buttons">
|
|
|
|
<button class="input__button manage__user__button">Save</button>
|
|
|
|
<button class="input__button manage__user__button" type="reset">Reset</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if can_manage_users %}
|
|
|
|
{% if has_roles|length > 0 %}
|
|
|
|
<form method="post" action="" class="container">
|
|
|
|
{{ container_title('Manage Roles') }}
|
|
|
|
{{ input_csrf('users_edit') }}
|
|
|
|
|
|
|
|
<div class="container__content">
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Has Roles</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_select('manage_roles[role]', has_roles, manage_user.display_role, 'role_name', 'role_id') }}
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<button class="input__button" name="manage_roles[mode]" value="display">Set Display</button>
|
|
|
|
<button class="input__button" name="manage_roles[mode]" value="remove">Remove</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if available_roles|length > 0 %}
|
|
|
|
<form method="post" action="" class="container">
|
|
|
|
{{ container_title('Add role') }}
|
|
|
|
{{ input_csrf('users_edit') }}
|
|
|
|
|
|
|
|
<div class="container__content">
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Available Roles</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
{{ input_select('add_role[role]', available_roles, '', 'role_name', 'role_id') }}
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<button class="input__button">Add</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2018-08-15 20:29:18 +00:00
|
|
|
{% endif %}
|
2019-02-04 21:10:00 +00:00
|
|
|
</div>
|
2018-04-23 03:00:55 +00:00
|
|
|
{% endblock %}
|