2024-02-07 17:31:12 +13:00
{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
{% extends 'themes/' + theme() + '/base.html' %}
{% else %}
{% extends "base.html" %}
2024-12-10 12:16:52 +01:00
{% endif %}
2024-01-01 14:49:15 +13:00
{% from 'bootstrap/form.html' import render_form %}
2024-04-14 20:05:40 +12:00
{% set active_child = 'admin_users' %}
2024-01-01 14:49:15 +13:00
{% block app_content %}
2025-01-13 14:42:49 -05:00
{% include 'admin/_tabbed_nav.html' %}
< br >
2024-01-01 14:49:15 +13:00
< div class = "row" >
< div class = "col" >
2024-04-14 20:05:40 +12:00
< h1 > {{ _('Users') }}< / h1 >
2024-02-28 05:04:07 +13:00
< a class = "btn btn-primary" href = "{{ url_for('admin.admin_users_add') }}" style = "float: right;" > {{ _('Add local user') }}< / a >
2024-12-18 10:01:45 +01:00
< form id = "searchUsers" method = "get" >
< div >
< input type = "search" name = "search" placeholder = "{{ _('Search') }}" value = "{{ search }}" >
< input type = "submit" name = "submit_search" value = "{{ _('Search') }}" class = "btn btn-primary" >
< / div >
< div style = "display:inline;" >
< label for = "local_remote" > Local/Remote: < / label >
< select name = "local_remote" class = "form-control-sm submit_on_change" >
< option value = "" > All< / option >
< option value = "local" { { ' selected ' if local_remote = = ' local ' } } > Local< / option >
< option value = "remote" { { ' selected ' if local_remote = = ' remote ' } } > Remote< / option >
< / select >
< / div >
< div style = "display:inline;" >
< label for = "last_seen" > Active: < / label >
< select name = "last_seen" class = "form-control-sm submit_on_change" >
< option value = "0" > All< / option >
< option value = "7" { { ' selected ' if last_seen = = 7 } } > 7 days< / option >
< option value = "30" { { ' selected ' if last_seen = = 30 } } > 30 days< / option >
< / select >
< / div >
2024-12-28 11:38:40 +01:00
< input type = "hidden" name = "sort_by" value = "{{ sort_by }}" >
2024-01-01 14:49:15 +13:00
< / form >
2024-02-28 05:04:07 +13:00
< table class = "table table-striped mt-1" >
2024-01-01 14:49:15 +13:00
< tr >
2024-12-18 10:01:45 +01:00
< th >
< button form = "searchUsers" name = "sort_by_btn" value = "user_name{{' DESC' if sort_by == 'user_name ASC' else ' ASC' }}" class = "btn" title = "{{ _('Display name.') }}" >
{{ _('Name') }}
< span class = "{{ 'fe fe-chevron-up' if sort_by == 'user_name DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'user_name ASC' }}" > < / span >
< / button >
< / th >
2025-01-02 12:26:27 +01:00
< th >
< button form = "searchUsers" name = "sort_by_btn" value = "banned{{' ASC' if sort_by == 'banned DESC' else ' DESC' }}" class = "btn" title = "{{ _('This user has been banned.') }}" >
{{ _('Banned') }}
< span class = "{{ 'fe fe-chevron-up' if sort_by == 'banned ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'banned DESC' }}" > < / span >
< / button >
< / th >
2024-12-18 10:01:45 +01:00
< th >
< button form = "searchUsers" name = "sort_by_btn" value = "reports{{' ASC' if sort_by == 'reports DESC' else ' DESC' }}" class = "btn" title = "{{ _('How often a user has been reported.') }}" >
{{ _('Reports') }}
< span class = "{{ 'fe fe-chevron-up' if sort_by == 'reports ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'reports DESC' }}" > < / span >
< / button >
< / th >
< th >
2025-01-02 18:51:53 +01:00
< button form = "searchUsers" name = "sort_by_btn" value = "attitude{{' ASC' if sort_by == 'attitude DESC NULLS LAST' else ' DESC' }} NULLS LAST" class = "btn" title = "{{ _('Attitude: Percentage of up votes vs. down votes the account made.') }}" >
2024-12-18 10:01:45 +01:00
{{ _('Attitude') }}
2025-01-02 18:51:53 +01:00
< span class = "{{ 'fe fe-chevron-up' if sort_by == 'attitude ASC NULLS LAST' }}{{ 'fe fe-chevron-down' if sort_by == 'attitude DESC NULLS LAST' }}" > < / span >
2024-12-18 10:01:45 +01:00
< / button >
< / th >
< th >
< button form = "searchUsers" name = "sort_by_btn" value = "reputation{{' ASC' if sort_by == 'reputation DESC' else ' DESC' }}" class = "btn" title = "{{ _('Reputation: The Karma of the account. Total up votes minus down votes they got.') }}" >
{{ _('Reputation') }}
< span class = "{{ 'fe fe-chevron-up' if sort_by == 'reputation ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'reputation DESC' }}" > < / span >
< / button >
< / th >
< th >
< button form = "searchUsers" name = "sort_by_btn" value = "last_seen{{' ASC' if sort_by == 'last_seen DESC' else ' DESC' }}" class = "btn" title = "{{ _('Last seen.') }}" >
{{ _('Seen') }}
< span class = "{{ 'fe fe-chevron-up' if sort_by == 'last_seen ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'last_seen DESC' }}" > < / span >
< / button >
< / th >
2024-08-03 21:31:10 +12:00
< th > {{ _('Actions') }}< / th >
2024-01-01 14:49:15 +13:00
< / tr >
2024-02-06 17:40:03 +13:00
{% for user in users.items %}
2024-01-01 14:49:15 +13:00
< tr >
2025-01-06 21:23:33 +13:00
< td > < span title = "{{ _('Name') }}" > {{ render_username(user) }}< / span > < / td >
2025-01-02 16:37:42 +01:00
< td > < span title = "{{ _('Banned') }}" > {{ '< span class = "red" > Banned< / span > '|safe if user.banned }}
2024-12-02 15:03:16 +13:00
{{ '< span class = "red" > Banned posts< / span > '|safe if user.ban_posts }}
2025-01-02 16:37:42 +01:00
{{ '< span class = "red" > Banned comments< / span > '|safe if user.ban_comments }}< / span > < / td >
< td > < span title = "{{ _('Reports') }}" > {{ user.reports if user.reports > 0 }}< / span > < / td >
2025-01-06 11:23:35 +01:00
< td > < span title = "{{ _('Attitude') }}" > {% if user.attitude %}{{ (user.attitude * 100) | round | int }}%{% endif %}< / span > < / td >
2025-01-02 16:37:42 +01:00
< td > < span title = "{{ _('Reputation') }}" > {% if user.reputation %}R {{ user.reputation | round | int }}{% endif %}< / span > < / td >
< td > < span title = "{{ _('Last Seen') }}: {{ user.last_seen }}" > {{ arrow.get(user.last_seen).humanize(locale=locale) }}< / span > < / td >
2024-12-18 10:01:45 +01:00
< td > < a href = "{{ url_for('admin.admin_user_edit', user_id=user.id) }}" > Edit< / a > ,
< a href = "{{ url_for('admin.admin_user_delete', user_id=user.id) }}" class = "confirm_first" > Delete< / a > ,
< br / >
{% if user.banned %}
< a href = "{{ url_for('user.unban_profile', actor=user.link()) }}" class = "confirm_first" > Ban< / a > ,
{% else %}
< a href = "{{ url_for('user.ban_profile', actor=user.link()) }}" class = "confirm_first" > Ban< / a > ,
{% endif %}
< a href = "{{ url_for('user.ban_purge_profile', actor=user.link()) }}" class = "confirm_first" > Purge< / a >
2024-01-01 14:49:15 +13:00
< / td >
< / tr >
{% endfor %}
< / table >
2024-01-23 19:17:05 +13:00
< nav aria-label = "Pagination" class = "mt-4" role = "navigation" >
2024-01-01 14:49:15 +13:00
{% if prev_url %}
< a href = "{{ prev_url }}" class = "btn btn-primary" >
< span aria-hidden = "true" > ← < / span > {{ _('Previous page') }}
< / a >
{% endif %}
{% if next_url %}
< a href = "{{ next_url }}" class = "btn btn-primary" >
{{ _('Next page') }} < span aria-hidden = "true" > → < / span >
< / a >
{% endif %}
< / nav >
< / div >
< / div >
2024-04-14 20:05:40 +12:00
< hr / >
< div class = "row" >
< div class = "col" >
{% include 'admin/_nav.html' %}
< / div >
< / div >
< hr / >
2024-12-18 00:30:15 +01:00
{% endblock %}