1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-25 16:00:22 +01:00
vichan/templates/mod/users.html

72 lines
2.5 KiB
HTML
Raw Normal View History

2012-04-13 14:00:40 +02:00
<table class="modlog" style="width:auto">
<tr>
2012-05-05 17:33:10 +02:00
<th>{% trans 'ID' %}</th>
<th>{% trans 'Username' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Boards' %}</th>
{% if mod|hasPermission(config.mod.modlog) %}
<th>{% trans 'Last action' %}</th>
{% endif %}
2012-04-13 14:00:40 +02:00
<th>&hellip;</th>
</tr>
{% for user in users %}
<tr>
<td><small>{{ user.id }}</small></td>
2012-05-05 17:33:10 +02:00
<td>{{ user.username|e }}</td>
2012-04-13 14:00:40 +02:00
<td>
2012-05-05 17:33:10 +02:00
{% if user.type == constant('JANITOR') %}{% trans 'Janitor' %}
{% elseif user.type == constant('MOD') %}{% trans 'Mod' %}
{% elseif user.type == constant('ADMIN') %}{% trans 'Admin' %}
2012-04-13 14:00:40 +02:00
{% endif %}
</td>
<td>
2012-05-05 17:33:10 +02:00
{% if user.boards == '' %}
<em>{% trans 'none' %}</em>
{% elseif user.boards == '*' %}
<em>{% trans 'all boards' %}</em>
{% else %}
{# This is really messy, but IMO it beats doing it in PHP. #}
{% set boards = user.boards|split(',') %}
{% set _boards = [] %}
{% for board in boards %}
{% set _boards = _boards|push(board == '*' ? '*' : config.board_abbreviation|sprintf(board)) %}
{% endfor %}
{% set _boards = _boards|sort %}
{{ _boards|join(', ') }}
{% endif %}
2012-04-13 14:00:40 +02:00
</td>
{% if mod|hasPermission(config.mod.modlog) %}
<td>
{% if user.last %}
<span title="{{ user.action|e }}">{{ user.last|ago }}</span>
{% else %}
2012-05-05 17:33:10 +02:00
<em>{% trans 'never' %}</em>
{% endif %}
</td>
{% endif %}
2012-04-13 14:00:40 +02:00
<td>
{% if mod|hasPermission(config.mod.promoteusers) and user.type < constant('ADMIN') %}
2012-05-05 17:33:10 +02:00
<a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/promote" title="{% trans 'Promote' %}">&#9650;</a>
2012-04-13 14:00:40 +02:00
{% endif %}
{% if mod|hasPermission(config.mod.promoteusers) and user.type > constant('JANITOR') %}
2012-05-05 17:33:10 +02:00
<a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/demote" title="{% trans 'Demote' %}">&#9660;</a>
2012-04-13 14:00:40 +02:00
{% endif %}
2012-05-06 04:29:54 +02:00
{% if mod|hasPermission(config.mod.editusers) or (mod|hasPermission(config.mod.change_password) and mod.id == user.id) %}
2012-05-05 17:33:10 +02:00
<a class="unimportant" style="margin-left:5px;float:right" href="?/users/{{ user.id }}">[{% trans 'edit' %}]</a>
2012-04-13 14:00:40 +02:00
{% endif %}
{% if mod|hasPermission(config.mod.create_pm) %}
2012-05-05 17:33:10 +02:00
<a class="unimportant" style="margin-left:5px;float:right" href="?/new_PM/{{ user.username|e }}">[{% trans 'PM' %}]</a>
2012-04-13 14:00:40 +02:00
{% endif %}
</td>
</tr>
{% endfor %}
</table>
2012-05-05 17:33:10 +02:00
{% if mod|hasPermission(config.mod.createusers) %}
<p style="text-align:center">
<a href="?/users/new">Create a new user</a>
</p>
{% endif %}