misuzu/templates/manage/users/warnings.twig

85 lines
4.7 KiB
Twig
Raw Normal View History

2022-09-13 13:14:49 +00:00
{% extends 'manage/users/master.twig' %}
2023-07-26 22:43:50 +00:00
{% from 'macros.twig' import pagination, container_title, avatar %}
2022-09-13 13:14:49 +00:00
2023-07-26 22:43:50 +00:00
{% set warns_pagination = pagination(manage_warns_pagination, url('manage-users-warnings', {'user': manage_warns_filter_user.id|default(0)})) %}
{% set warns_filtering = manage_warns_filter_user is not null %}
2022-09-13 13:14:49 +00:00
2023-07-26 22:43:50 +00:00
{% block manage_content %}
<div class="container manage__warnings">
2022-09-13 13:14:49 +00:00
{{ container_title('<i class="fas fa-exclamation-circle fa-fw"></i> Warnings') }}
2023-07-26 22:43:50 +00:00
<div class="manage__description">
List of user warnings.
{% if not warns_filtering %}Filter by a user to issue a new warning.{% endif %}
</div>
2022-09-13 13:14:49 +00:00
2023-07-26 22:43:50 +00:00
{% if warns_pagination|trim|length > 0 %}
<div class="manage__warnings__pagination">
{{ warns_pagination }}
</div>
{% endif %}
2022-09-13 13:14:49 +00:00
2023-07-26 22:43:50 +00:00
{% if warns_filtering %}
<div class="manage__warnings__actions">
<a href="{{ url('manage-users-warning', {'user': manage_warns_filter_user.id}) }}" class="input__button">Issue new Warning</a>
</div>
{% endif %}
<div class="manage__warnings__list">
{% for warn in manage_warns %}
<div class="manage__warnings__item">
<div class="manage__warnings__item__header">
<div class="manage__warnings__item__attributes">
{% if warn.mod is not null %}
<div class="manage__warnings__item__attribute manage__warnings__item__author" style="--user-colour: {{ warn.mod.colour }}">
<div class="manage__warnings__item__author__prefix">Issued by</div>
<div class="manage__warnings__item__author__avatar">
<a href="{{ url('user-profile', {'user': warn.mod.id}) }}">{{ avatar(warn.mod.id, 20, warn.mod.username) }}</a>
</div>
<div class="manage__warnings__item__author__name">
<a href="{{ url('user-profile', {'user': warn.mod.id}) }}">{{ warn.mod.username }}</a>
</div>
</div>
{% endif %}
<div class="manage__warnings__item__attribute manage__warnings__item__created">
<div class="manage__warnings__item__created__icon"><i class="fas fa-clock"></i></div>
<div class="manage__warnings__item__created__time">
<time datetime="{{ warn.info.createdTime|date('c') }}" title="{{ warn.info.createdTime|date('r') }}">{{ warn.info.createdTime|time_format }}</time>
</div>
2022-09-13 13:14:49 +00:00
</div>
2023-07-26 22:43:50 +00:00
<div class="manage__warnings__item__attribute manage__warnings__item__user" style="--user-colour: {{ warn.user.colour }}">
<div class="manage__warnings__item__user__prefix">Subject</div>
<div class="manage__warnings__item__user__avatar">
<a href="{{ url('manage-user', {'user': warn.user.id}) }}">{{ avatar(warn.user.id, 20, warn.user.username) }}</a>
</div>
<div class="manage__warnings__item__user__name">
<a href="{{ url('manage-user', {'user': warn.user.id}) }}">{{ warn.user.username }}</a>
</div>
{% if not warns_filtering %}
<div class="manage__warnings__item__user__filter">
<a href="{{ url('manage-users-warnings', {'user': warn.user.id}) }}">Filter</a>
</div>
{% endif %}
2022-09-13 13:14:49 +00:00
</div>
</div>
2023-07-26 22:43:50 +00:00
<div class="manage__warnings__item__actions">
<a href="{{ url('manage-users-warning-delete', {'warn': warn.info.id}) }}" title="Remove" class="input__button input__button--autosize input__button--destroy manage__warnings__item__action" onclick="return confirm('Are you sure?');"><i class="fas fa-times fa-fw"></i></a>
2022-09-13 13:14:49 +00:00
</div>
</div>
2023-07-26 22:43:50 +00:00
<div class="manage__warnings__item__reason">
{% for line in warn.info.bodyLines %}
<p>{{ line }}</p>
{% endfor %}
2022-09-13 13:14:49 +00:00
</div>
</div>
2023-07-26 22:43:50 +00:00
{% endfor %}
2022-09-13 13:14:49 +00:00
</div>
2023-07-26 22:43:50 +00:00
{% if warns_pagination|trim|length > 0 %}
<div class="manage__warnings__pagination">
{{ warns_pagination }}
</div>
{% endif %}
2022-09-13 13:14:49 +00:00
</div>
{% endblock %}