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-25 01:35:53 +00:00
|
|
|
{% from '_layout/input.twig' import input_csrf, input_text %}
|
2018-03-31 22:28:32 +00:00
|
|
|
|
2018-08-15 17:20:41 +00:00
|
|
|
{% block manage_content %}
|
2018-10-22 19:53:21 +00:00
|
|
|
<form action="?v=role{{ edit_role is defined ? '&r=' ~ edit_role.role_id : '' }}" method="post"{% if edit_role is defined %} style="{{ edit_role.role_colour|html_colour('--accent-colour') }}"{% endif %}>
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_csrf('users_role') }}
|
2018-10-02 19:16:42 +00:00
|
|
|
|
2018-03-31 22:28:32 +00:00
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title(edit_role is defined ? 'Editing ' ~ edit_role.role_name ~ ' (' ~ edit_role.role_id ~ ')' : 'Creating a new role') }}
|
2018-03-31 22:28:32 +00:00
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Role Name</div>
|
|
|
|
<div class="form__label__input">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('role[name]', '', edit_role.role_name|default(''), 'text', '', true, {'maxlength':255}) }}
|
2018-03-31 22:28:32 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Hide Rank</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
<input class="input" type="checkbox" name="role[secret]"{% if edit_role is defined and edit_role.role_secret %} checked{% endif %}>
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Hierarchy</div>
|
|
|
|
<div class="form__label__input">
|
|
|
|
<input class="input input--number" type="number" value="{{ edit_role is defined ? edit_role.role_hierarchy : '1' }}" min="1" max="100" name="role[hierarchy]">
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2018-07-08 19:24:59 +00:00
|
|
|
<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('role[title]', '', edit_role.role_title|default(''), 'text', '', false, {'maxlength':64}) }}
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2018-08-15 17:20:41 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Colour') }}
|
2018-03-31 22:28:32 +00:00
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Inherit Colour</div>
|
|
|
|
<div class="form__label__input">
|
2018-04-30 21:39:43 +00:00
|
|
|
<input class="input" type="checkbox" name="role[colour][inherit]"{% if edit_role is defined and edit_role.role_colour|colour_get_inherit %} checked{% endif %}>
|
2018-03-31 22:28:32 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Red</div>
|
|
|
|
<div class="form__label__input">
|
2018-04-30 21:39:43 +00:00
|
|
|
<input class="input input--number" type="number" value="{{ edit_role is defined ? edit_role.role_colour|colour_get_red : '0' }}" min="0" max="255" name="role[colour][red]">
|
2018-03-31 22:28:32 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Green</div>
|
|
|
|
<div class="form__label__input">
|
2018-04-30 21:39:43 +00:00
|
|
|
<input class="input input--number" type="number" value="{{ edit_role is defined ? edit_role.role_colour|colour_get_green : '0' }}" min="0" max="255" name="role[colour][green]">
|
2018-03-31 22:28:32 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Blue</div>
|
|
|
|
<div class="form__label__input">
|
2018-04-30 21:39:43 +00:00
|
|
|
<input class="input input--number" type="number" value="{{ edit_role is defined ? edit_role.role_colour|colour_get_blue : '0' }}" min="0" max="255" name="role[colour][blue]">
|
2018-03-31 22:28:32 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2018-08-15 17:20:41 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="container">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Additional') }}
|
2018-03-31 22:28:32 +00:00
|
|
|
|
|
|
|
<label class="form__label">
|
|
|
|
<div class="form__label__text">Description</div>
|
|
|
|
<div class="form__label__input">
|
2018-08-15 02:25:42 +00:00
|
|
|
<textarea class="input__textarea" name="role[description]" maxlength="1000">{{ edit_role is defined ? edit_role.role_description : '' }}</textarea>
|
2018-03-31 22:28:32 +00:00
|
|
|
</div>
|
|
|
|
</label>
|
2018-07-08 19:24:59 +00:00
|
|
|
</div>
|
2018-03-31 22:28:32 +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-03-31 22:28:32 +00:00
|
|
|
</div>
|
2018-07-08 19:24:59 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2018-10-02 19:16:42 +00:00
|
|
|
<button class="input__button">{{ edit_role is defined ? 'Update role' : 'Create role' }}</button>
|
2018-03-31 22:28:32 +00:00
|
|
|
</form>
|
|
|
|
{% endblock %}
|