2012-04-13 08:00:40 -04:00
< table class = "modlog" style = "width:auto" >
< tr >
2012-05-05 11:33:10 -04:00
< th > {% trans 'ID' %}< / th >
< th > {% trans 'Username' %}< / th >
< th > {% trans 'Type' %}< / th >
< th > {% trans 'Boards' %}< / th >
2012-05-05 22:31:15 -04:00
{% if mod|hasPermission(config.mod.modlog) %}
< th > {% trans 'Last action' %}< / th >
{% endif %}
2012-04-13 08:00:40 -04:00
< th > … < / th >
< / tr >
{% for user in users %}
< tr >
< td > < small > {{ user.id }}< / small > < / td >
2012-05-05 11:33:10 -04:00
< td > {{ user.username|e }}< / td >
2012-04-13 08:00:40 -04:00
< td >
2013-09-08 11:33:51 -04:00
{% if config.mod.groups[user.type] %}
{{ config.mod.groups[user.type] }}
{% else %}
< em > {% trans 'Unknown' %}< / em > ({{ user.type }})
2012-04-13 08:00:40 -04:00
{% endif %}
< / td >
< td >
2012-05-05 11:33:10 -04: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 08:00:40 -04:00
< / td >
2012-05-05 22:31:15 -04:00
{% if mod|hasPermission(config.mod.modlog) %}
< td >
2012-04-14 08:28:21 -04:00
{% if user.last %}
< span title = "{{ user.action|e }}" > {{ user.last|ago }}< / span >
{% else %}
2012-05-05 11:33:10 -04:00
< em > {% trans 'never' %}< / em >
2012-04-14 08:28:21 -04:00
{% endif %}
2012-05-05 22:31:15 -04:00
< / td >
{% endif %}
2012-04-13 08:00:40 -04:00
< td >
2013-09-08 11:33:51 -04:00
{% if mod|hasPermission(config.mod.promoteusers) and user.type < constant ( config . mod . groups [ 0:-1 ] | last ) % }
2012-05-05 11:33:10 -04:00
< a style = "float:left;text-decoration:none" href = "?/users/{{ user.id }}/promote" title = "{% trans 'Promote' %}" > ▲ < / a >
2012-04-13 08:00:40 -04:00
{% endif %}
2013-09-08 11:33:51 -04:00
{% if mod|hasPermission(config.mod.promoteusers) and user.type > constant(config.mod.groups|first) %}
2013-09-09 05:17:18 -04:00
< a style = "float:left;text-decoration:none" href = "?/users/{{ user.id }}/demote" title = "{% trans 'Demote' %}" { % if mod . id = = user . id % } onclick = "return confirm('{% trans 'Are you sure you want to demote yourself?' %}')" { % endif % } > ▼ < / a >
2012-04-13 08:00:40 -04:00
{% endif %}
2012-08-27 11:47:26 -04:00
{% if mod|hasPermission(config.mod.modlog) %}
< a class = "unimportant" style = "margin-left:5px;float:right" href = "?/log:{{ user.username|e }}" > [{% trans 'log' %}]< / a >
{% endif %}
2012-05-05 22:29:54 -04:00
{% if mod|hasPermission(config.mod.editusers) or (mod|hasPermission(config.mod.change_password) and mod.id == user.id) %}
2012-05-05 11:33:10 -04:00
< a class = "unimportant" style = "margin-left:5px;float:right" href = "?/users/{{ user.id }}" > [{% trans 'edit' %}]< / a >
2012-04-13 08:00:40 -04:00
{% endif %}
{% if mod|hasPermission(config.mod.create_pm) %}
2012-05-05 11:33:10 -04:00
< a class = "unimportant" style = "margin-left:5px;float:right" href = "?/new_PM/{{ user.username|e }}" > [{% trans 'PM' %}]< / a >
2012-04-13 08:00:40 -04:00
{% endif %}
< / td >
< / tr >
{% endfor %}
< / table >
2012-05-05 11:33:10 -04:00
{% if mod|hasPermission(config.mod.createusers) %}
< p style = "text-align:center" >
< a href = "?/users/new" > Create a new user< / a >
< / p >
{% endif %}