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 %}
|
2018-10-27 21:38:01 +00:00
|
|
|
{% from '_layout/input.twig' import input_csrf, input_text, input_checkbox, input_file, input_select %}
|
2018-04-23 03:00:55 +00:00
|
|
|
|
2018-09-25 21:21:11 +00:00
|
|
|
{% set site_link = '/profile.php?u=' ~ view_user.user_id %}
|
|
|
|
|
2018-08-15 17:20:41 +00:00
|
|
|
{% block manage_content %}
|
2018-07-08 19:24:59 +00:00
|
|
|
{% if can_manage_users %}
|
2018-10-22 19:53:21 +00:00
|
|
|
<form method="post" enctype="multipart/form-data" action=""{% if view_user is defined %} style="{{ view_user.user_colour|html_colour('--accent-colour') }}"{% endif %}>
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_csrf('users_edit') }}
|
2018-10-02 19:16:42 +00:00
|
|
|
|
2018-07-08 19:24:59 +00:00
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Viewing ' ~ view_user.username ~ ' (' ~ view_user.user_id ~ ')') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Username</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('user[username]', '', view_user.username, 'text', '', true, {'maxlength':16}) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">E-mail address</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('user[email]', '', view_user.email, 'text', '', true, {'maxlength':255}) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Title</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('user[title]', '', view_user.user_title, 'text', '', false, {'maxlength':64}) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Joined</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-29 21:18:53 +00:00
|
|
|
{{ input_text('', '', view_user.user_created) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Last online</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-29 21:18:53 +00:00
|
|
|
{{ input_text('', '', view_user.user_active) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Register IP</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('', '', view_user.register_ip_decoded) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Last IP</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('', '', view_user.last_ip_decoded) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Country</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('user[country]', '', view_user.user_country, 'text', 'XX', true, {'maxlength':2,'minlength':2}) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Avatar') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">New Avatar</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-27 18:50:34 +00:00
|
|
|
{{ input_file('avatar[file]') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Delete Avatar</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-27 14:29:13 +00:00
|
|
|
{{ input_checkbox('avatar[delete]') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Password') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">New Password</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('password[new]', '', '', 'password') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Confirm Password</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('password[confirm]', '', '', 'password') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2018-08-15 02:25:42 +00:00
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Colour') }}
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2018-10-29 22:00:49 +00:00
|
|
|
{% set colour_props = view_user.user_colour|default(constant('MSZ_COLOUR_INHERIT'))|colour_props %}
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2018-08-15 02:25:42 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Custom Colour</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-29 22:00:49 +00:00
|
|
|
{{ input_checkbox('colour[enable]', '', colour_props.inherit) }}
|
2018-08-15 02:25:42 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2018-08-15 02:25:42 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Red</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-29 22:00:49 +00:00
|
|
|
{{ input_text('colour[red]', '', colour_props.red, 'number', '', false, {'min':0,'max':255}) }}
|
2018-08-15 02:25:42 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2018-08-15 02:25:42 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Green</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-29 22:00:49 +00:00
|
|
|
{{ input_text('colour[green]', '', colour_props.green, 'number', '', false, {'min':0,'max':255}) }}
|
2018-08-15 02:25:42 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2018-08-15 02:25:42 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Blue</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-29 22:00:49 +00:00
|
|
|
{{ input_text('colour[blue]', '', colour_props.blue, 'number', '', false, {'min':0,'max':255}) }}
|
2018-08-15 02:25:42 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
</div>
|
2018-07-18 16:01:17 +00:00
|
|
|
|
2018-07-08 19:24:59 +00:00
|
|
|
{% if can_manage_perms %}
|
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Permissions') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
{{ permissions_table(permissions) }}
|
2018-05-27 01:59:57 +00:00
|
|
|
</div>
|
2018-07-08 19:24:59 +00:00
|
|
|
{% endif %}
|
2018-05-27 01:59:57 +00:00
|
|
|
|
2018-10-02 19:16:42 +00:00
|
|
|
<button class="input__button">Update</button>
|
2018-05-27 01:59:57 +00:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
2018-07-08 19:24:59 +00:00
|
|
|
{% if can_manage_users %}
|
2018-08-15 20:29:18 +00:00
|
|
|
{% if has_roles|length > 0 %}
|
|
|
|
<form method="post" action="" class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Manage Roles') }}
|
2018-10-27 21:38:01 +00:00
|
|
|
{{ input_csrf('users_edit') }}
|
2018-10-22 19:53:21 +00:00
|
|
|
|
2018-08-15 20:29:18 +00:00
|
|
|
<div class="container__content">
|
2018-07-08 19:24:59 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Has Roles</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-27 21:38:01 +00:00
|
|
|
{{ input_select('manage_roles[role]', has_roles, view_user.display_role, 'role_name', 'role_id') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2018-08-15 20:29:18 +00:00
|
|
|
<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 %}
|
2018-07-08 19:24:59 +00:00
|
|
|
|
2018-08-15 20:29:18 +00:00
|
|
|
{% if available_roles|length > 0 %}
|
|
|
|
<form method="post" action="" class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Add role') }}
|
2018-10-27 21:38:01 +00:00
|
|
|
{{ input_csrf('users_edit') }}
|
2018-10-22 19:53:21 +00:00
|
|
|
|
2018-08-15 20:29:18 +00:00
|
|
|
<div class="container__content">
|
2018-07-08 19:24:59 +00:00
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Available Roles</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-27 21:38:01 +00:00
|
|
|
{{ input_select('add_role[role]', available_roles, '', 'role_name', 'role_id') }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2018-10-27 21:38:01 +00:00
|
|
|
<button class="input__button">Add</button>
|
2018-08-15 20:29:18 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2018-05-27 01:59:57 +00:00
|
|
|
{% endif %}
|
2018-04-23 03:00:55 +00:00
|
|
|
{% endblock %}
|