leilukin-tumbleblog/admin/pages/manage_users.twig

86 lines
2.9 KiB
Twig

{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block title %}{{ "Manage Users" | translate }}{% endblock %}
{% block content %}
<form class="filters" action="{{ url('manage_users') }}" method="post" accept-charset="UTF-8" role="search">
<fieldset role="presentation">
<label for="query">
{{ "Search&hellip;" | translate }}
<a href="{{ url('help/id/filtering_results') }}" rel="help" target="_blank" class="help emblem">
{{- icon_img("help.svg", "help" | translate) -}}
</a>
</label>
<input class="text filter_text" type="text" name="query" value="{{ GET.query | fix(true, true) }}" id="query">
<button type="submit">{{ "Search" | translate }}</button>
{% if visitor.group.can("add_user") %}
<a href="{{ url('new_user') }}" class="button yay">
{{ icon_img("add.svg") }}{{ "New User" | translate }}
</a>
{% endif %}
</fieldset>
</form>
<h2>{{ GET.query is not empty ? "Search Results" | translate : "Users" | translate }}</h2>
<table>
<thead>
<tr class="head">
<th class="user_name name main">{{ "Login (name)" | translate }}</th>
<th class="user_group value">{{ "Group" | translate }}</th>
<th class="user_joined date">{{ "Joined" | translate }}</th>
<th class="user_website name">{{ "Website" | translate }}</th>
{% if site.email_activation %}
<th class="user_activated emblem" title="approved">{{ "Activated?" | translate }}</th>
{% endif %}
{{ trigger.call("manage_users_column_header") }}
<th class="controls" colspan="2">{{ "Controls" | translate }}</th>
</tr>
</thead>
<tbody>
{% for user in users.paginated %}
<tr id="user_{{ user.id }}" class="user">
<td class="user_name name main">
<a href="mailto:{{ user.email | fix(true) }}">{{ user.login }}</a>
{% if user.full_name is not empty %}<span class="sub">({{ user.full_name }})</span>{% endif %}
</td>
<td class="user_group value">
{{ user.group.name }}
</td>
<td class="user_joined date">
{{ user.joined_at | time }}
</td>
<td class="user_website name">
{% if user.website is not empty %}<a href="{{ user.website | fix(true) }}">{{ user.website }}</a>{% endif %}
</td>
{% if site.email_activation %}
<td class="user_activated emblem">
{% if user.approved %}
{{ icon_img("success.svg", "yes" | translate, "emblem") }}
{% endif %}
</td>
{% endif %}
{{ trigger.call("manage_users_column", user) }}
<td class="controls">
{{ user.edit_link(icon_img("edit.svg", "edit" | translate), null, null, "emblem") }}
</td>
<td class="controls">
{{ user.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 users.paginated is not empty and users.pages > 1 %}
<div class="pagination">
<span class="pages">{{ "Page %d of %s" | translate | format(users.page, users.final_link(users.pages)) }}</span>
{{ users.prev_link }}
{{ users.next_link }}
</div>
{% endif %}
{% endblock %}