leilukin-tumbleblog/admin/pages/manage_groups.twig

74 lines
2.5 KiB
Twig
Raw Normal View History

2024-06-20 14:10:42 +00:00
{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block title %}{{ "Manage Groups" | translate }}{% endblock %}
{% block content %}
<form class="filters" action="{{ url('manage_groups') }}" method="post" accept-charset="UTF-8" role="search">
<fieldset role="presentation">
<label for="search">{{ "Search all groups for user&hellip;" | translate }}</label>
<input class="text filter_text" type="text" name="search" value="{{ GET.search is defined ? GET.search | fix(true, true) : '' }}" id="search">
<button type="submit">{{ "Search" | translate }}</button>
{% if visitor.group.can("add_group") %}
<a href="{{ url('new_group') }}" class="button yay">
{{ icon_img("add.svg") }}{{ "New Group" | translate }}
</a>
{% endif %}
</fieldset>
</form>
<h2>{{ GET.search is defined ? "Search Results" | translate : "Groups" | translate }}</h2>
<table>
<thead>
<tr class="head">
<th class="group_name name main">{{ "Group" | translate }}</th>
<th class="group_size value">{{ "Members" | translate }}</th>
<th class="group_default emblem">{{ "Default?" | translate }}</th>
<th class="group_guest emblem">{{ "Guests?" | translate }}</th>
{{ trigger.call("manage_groups_column_header") }}
<th class="controls" colspan="2">{{ "Controls" | translate }}</th>
</tr>
</thead>
<tbody>
{% for group in groups.paginated %}
<tr id="group_{{ group.id }}" class="group">
<td class="group_name name main">
{{ group.name }}
</td>
<td class="group_size value">
<a href="{{ url('manage_users/query/' ~ (('group:' ~ group.name) | url_encode)) }}">{{ group.size }}</a>
</td>
<td class="group_default emblem">
{% if group.id == site.default_group %}
{{ icon_img("success.svg", "yes" | translate, "emblem") }}
{% endif %}
</td>
<td class="group_guest emblem">
{% if group.id == site.guest_group %}
{{ icon_img("success.svg", "yes" | translate, "emblem") }}
{% endif %}
</td>
{{ trigger.call("manage_groups_column", groups) }}
<td class="controls">
{{ group.edit_link(icon_img("edit.svg", "edit" | translate), null, null, "emblem") }}
</td>
<td class="controls">
{{ group.delete_link(icon_img("delete.svg", "delete" | translate), null, null, "emblem") }}
</td>
</tr>
{% else %}
<tr>
<td class="placeholder">
{{ icon_img("failure.svg", "", "emblem") }} {{ "No results" | translate }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if groups.paginated is not empty and groups.pages > 1 %}
<div class="pagination">
<span class="pages">{{ "Page %d of %s" | translate | format(groups.page, groups.final_link(groups.pages)) }}</span>
{{ groups.prev_link }}
{{ groups.next_link }}
</div>
{% endif %}
{% endblock %}