{% extends 'manage/users/master.twig' %} {% from 'macros.twig' import pagination, container_title %} {% from 'user/macros.twig' import user_profile_warning %} {% from '_layout/input.twig' import input_text, input_csrf, input_select, input_hidden %} {% block manage_content %}
{{ container_title(' Filters') }} {{ input_text('lookup', null, warnings.username, 'text', 'Enter a username') }}
{% if warnings.notices|length > 0 %}
{% for notice in warnings.notices %} {{ notice }} {% endfor %}
{% endif %} {% if warnings.user_id > 0 and warnings.username|length > 0 %}{# shittiest validation in the world, but it should work #}
{{ container_title(' Warn ' ~ warnings.username) }} {{ input_csrf('users_edit') }} {{ input_hidden('warning[user]', warnings.user_id) }} {{ input_select('warning[type]', warnings.types) }} {{ input_text('warning[note]', '', '', 'text', 'Public note') }} {{ input_select('warning[duration]', warnings.durations) }} {{ input_text('warning[duration_custom]', '', '', 'text', 'Custom Duration') }}
{% endif %}
{{ container_title(' Warnings') }} {% set warnpag = pagination(warnings.pagination, '/manage/users.php', null, {'v': 'warnings'}) %} {{ warnpag }}
User
User IP
Issuer
Issuer IP
Type
Created
Expires
Note
{% for warning in warnings.list %} {{ user_profile_warning(warning, true, true, csrf_token('warning-delete[%d]'|format(warning.warning_id))) }} {% endfor %}
{{ warnpag }}
{% endblock %}