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 14:29:13 +00:00
|
|
|
{% from '_layout/input.twig' import input_csrf, input_text, input_checkbox %}
|
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-25 01:35:53 +00:00
|
|
|
{{ input_text('', '', view_user.created_at) }}
|
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-25 01:35:53 +00:00
|
|
|
{{ input_text('', '', view_user.last_seen) }}
|
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-08-15 02:25:42 +00:00
|
|
|
<input class="input__text" type="file" name="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-08-15 02:25:42 +00:00
|
|
|
{% set colour_is_defined = view_user is defined and view_user.user_colour is not null and not view_user.user_colour|colour_get_inherit %}
|
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-27 14:29:13 +00:00
|
|
|
{{ input_checkbox('colour[enable]', '', colour_is_defined) }}
|
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">
|
|
|
|
<input class="input input--number" type="number" value="{{ colour_is_defined ? view_user.user_colour|colour_get_red : '0' }}" min="0" max="255" name="colour[red]">
|
|
|
|
</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">
|
|
|
|
<input class="input input--number" type="number" value="{{ colour_is_defined ? view_user.user_colour|colour_get_green : '0' }}" min="0" max="255" name="colour[green]">
|
|
|
|
</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">
|
|
|
|
<input class="input input--number" type="number" value="{{ colour_is_defined ? view_user.user_colour|colour_get_blue : '0' }}" min="0" max="255" name="colour[blue]">
|
|
|
|
</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-08-15 20:29:18 +00:00
|
|
|
<div class="container__content">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_csrf('users_edit') }}
|
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-08-15 17:20:41 +00:00
|
|
|
<select name="manage_roles[role]" class="input__select">
|
2018-07-08 19:24:59 +00:00
|
|
|
{% for role in has_roles %}
|
|
|
|
<option value="{{ role.role_id }}"{% if role.role_id == view_user.display_role %} selected{% endif %}>
|
|
|
|
{{ role.role_name }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</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-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-08-15 17:20:41 +00:00
|
|
|
<select name="add_role[role]" class="input__select">
|
2018-07-08 19:24:59 +00:00
|
|
|
{% for role in available_roles %}
|
|
|
|
<option value="{{ role.role_id }}">
|
|
|
|
{{ role.role_name }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2018-10-02 19:16:42 +00:00
|
|
|
<button class="input__button" name="csrf" value="{{ csrf_token('users_edit') }}">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 %}
|