misuzu/templates/manage/users/roles.twig

79 lines
3.6 KiB
Twig
Raw Normal View History

2022-09-13 13:14:49 +00:00
{% extends 'manage/users/master.twig' %}
{% from 'macros.twig' import pagination, container_title %}
{% set roles_pagination = pagination(manage_roles_pagination, url('manage-roles')) %}
{% block manage_content %}
<div class="container manage__roles">
{{ container_title('<i class="fas fa-user-check fa-fw"></i> Roles') }}
{% if roles_pagination|trim|length > 0 %}
<div class="manage__roles__pagination">
{{ roles_pagination }}
</div>
{% endif %}
<div class="manage__roles__collection">
<div class="manage__role-item manage__role-item--create">
<a href="{{ url('manage-role') }}" class="manage__role-item__background"></a>
<div class="manage__role-item__container">
<div class="manage__role-item__icon">
<div class="manage__role-item__icon__background"></div>
<div class="manage__role-item__icon__content">
<i class="fas fa-plus-circle fa-fw"></i>
</div>
</div>
<div class="manage__role-item__info">
<div class="manage__role-item__name">
Create a new role
</div>
</div>
</div>
</div>
{% for role in manage_roles %}
<div class="manage__role-item" style="--accent-colour: {{ role.colour }}">
<a href="{{ url('manage-role', {'role': role.id}) }}" class="manage__role-item__background"></a>
<div class="manage__role-item__container">
<div class="manage__role-item__icon">
<div class="manage__role-item__icon__background"></div>
<div class="manage__role-item__icon__content">
<i class="fas fa-toilet-paper fa-fw"></i>
</div>
</div>
<div class="manage__role-item__info">
<div class="manage__role-item__name">
{{ role.name }}
</div>
<div class="manage__role-item__details">
{% if role.userCount > 0 %}
<div class="manage__role-item__users">
<i class="fas fa-users fa-fw"></i> {{ role.userCount|number_format }}
</div>
{% endif %}
{% if role.title is not empty %}
<div class="manage__role-item__title">
{{ role.title }}
</div>
{% endif %}
</div>
</div>
<div class="manage__role-item__actions">
<a href="{{ url('user-list', {'role': role.id}) }}" class="manage__role-item__action" title="Members">
<i class="fas fa-users fa-fw"></i>
</a>
</div>
</div>
</div>
{% endfor %}
</div>
{% if roles_pagination|trim|length > 0 %}
<div class="manage__roles__pagination">
{{ roles_pagination }}
</div>
{% endif %}
</div>
{% endblock %}