mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Merge branch 'h3ndrik-admin_tables'
This commit is contained in:
commit
5e7eb86e6d
4 changed files with 182 additions and 73 deletions
|
@ -884,17 +884,21 @@ def admin_communities():
|
||||||
|
|
||||||
page = request.args.get('page', 1, type=int)
|
page = request.args.get('page', 1, type=int)
|
||||||
search = request.args.get('search', '')
|
search = request.args.get('search', '')
|
||||||
|
sort_by = request.args.get('sort_by', 'title ASC')
|
||||||
|
|
||||||
communities = Community.query
|
communities = Community.query
|
||||||
if search:
|
if search:
|
||||||
communities = communities.filter(Community.title.ilike(f"%{search}%"))
|
communities = communities.filter(Community.title.ilike(f"%{search}%"))
|
||||||
communities = communities.order_by(Community.title).paginate(page=page, per_page=1000, error_out=False)
|
communities = communities.order_by(text('"community".' + sort_by))
|
||||||
|
communities = communities.paginate(page=page, per_page=1000, error_out=False)
|
||||||
|
|
||||||
next_url = url_for('admin.admin_communities', page=communities.next_num) if communities.has_next else None
|
next_url = url_for('admin.admin_communities', page=communities.next_num, search=search, sort_by=sort_by) if communities.has_next else None
|
||||||
prev_url = url_for('admin.admin_communities', page=communities.prev_num) if communities.has_prev and page != 1 else None
|
prev_url = url_for('admin.admin_communities', page=communities.prev_num, search=search, sort_by=sort_by) if communities.has_prev and page != 1 else None
|
||||||
|
|
||||||
return render_template('admin/communities.html', title=_('Communities'), next_url=next_url, prev_url=prev_url,
|
return render_template('admin/communities.html', title=_('Communities'), next_url=next_url, prev_url=prev_url,
|
||||||
communities=communities, moderating_communities=moderating_communities(current_user.get_id()),
|
communities=communities,
|
||||||
|
search=search, sort_by=sort_by,
|
||||||
|
moderating_communities=moderating_communities(current_user.get_id()),
|
||||||
joined_communities=joined_communities(current_user.get_id()),
|
joined_communities=joined_communities(current_user.get_id()),
|
||||||
menu_topics=menu_topics(),
|
menu_topics=menu_topics(),
|
||||||
site=g.site)
|
site=g.site)
|
||||||
|
@ -1521,9 +1525,10 @@ def admin_instances():
|
||||||
page = request.args.get('page', 1, type=int)
|
page = request.args.get('page', 1, type=int)
|
||||||
search = request.args.get('search', '')
|
search = request.args.get('search', '')
|
||||||
filter = request.args.get('filter', '')
|
filter = request.args.get('filter', '')
|
||||||
|
sort_by = request.args.get('sort_by', 'domain ASC')
|
||||||
low_bandwidth = request.cookies.get('low_bandwidth', '0') == '1'
|
low_bandwidth = request.cookies.get('low_bandwidth', '0') == '1'
|
||||||
|
|
||||||
instances = Instance.query.order_by(Instance.domain)
|
instances = Instance.query
|
||||||
|
|
||||||
if search:
|
if search:
|
||||||
instances = instances.filter(Instance.domain.ilike(f"%{search}%"))
|
instances = instances.filter(Instance.domain.ilike(f"%{search}%"))
|
||||||
|
@ -1544,15 +1549,15 @@ def admin_instances():
|
||||||
elif filter == 'blocked':
|
elif filter == 'blocked':
|
||||||
instances = instances.join(BannedInstances, BannedInstances.domain == Instance.domain)
|
instances = instances.join(BannedInstances, BannedInstances.domain == Instance.domain)
|
||||||
|
|
||||||
# Pagination
|
instances = instances.order_by(text('"instance".' + sort_by))
|
||||||
instances = instances.paginate(page=page,
|
instances = instances.paginate(page=page,
|
||||||
per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
||||||
error_out=False)
|
error_out=False)
|
||||||
next_url = url_for('admin.admin_instances', page=instances.next_num) if instances.has_next else None
|
next_url = url_for('admin.admin_instances', page=instances.next_num, search=search, filter=filter, sort_by=sort_by) if instances.has_next else None
|
||||||
prev_url = url_for('admin.admin_instances', page=instances.prev_num) if instances.has_prev and page != 1 else None
|
prev_url = url_for('admin.admin_instances', page=instances.prev_num, search=search, filter=filter, sort_by=sort_by) if instances.has_prev and page != 1 else None
|
||||||
|
|
||||||
return render_template('admin/instances.html', instances=instances,
|
return render_template('admin/instances.html', instances=instances,
|
||||||
title=_(title), search=search,
|
title=_(title), search=search, filter=filter, sort_by=sort_by,
|
||||||
next_url=next_url, prev_url=prev_url,
|
next_url=next_url, prev_url=prev_url,
|
||||||
low_bandwidth=low_bandwidth,
|
low_bandwidth=low_bandwidth,
|
||||||
moderating_communities=moderating_communities(current_user.get_id()),
|
moderating_communities=moderating_communities(current_user.get_id()),
|
||||||
|
|
|
@ -12,8 +12,9 @@
|
||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<form method="get">
|
<form id="searchCommunities" method="get">
|
||||||
<input type="search" name="search"> <input type="submit" name="submit" value="Search">
|
<input type="search" name="search" placeholder="{{ _('Search') }}" value="{{ search }}">
|
||||||
|
<input type="submit" name="submit" value="Search">
|
||||||
</form>
|
</form>
|
||||||
Result Filter:
|
Result Filter:
|
||||||
<a href="{{ url_for('admin.admin_communities') }}">All</a> |
|
<a href="{{ url_for('admin.admin_communities') }}">All</a> |
|
||||||
|
@ -27,35 +28,87 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-striped">
|
<div class="table-responsive-md mt-4">
|
||||||
|
<table class="communities_table table table-striped table-hover w-100">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>
|
||||||
<th>Topic</th>
|
<button form="searchCommunities" name="sort_by" value="title{{' DESC' if sort_by == 'title ASC' else ' ASC' }}" class="btn" title="{{ _('Sort by name') }}">
|
||||||
<th># Posts</th>
|
{{ _('Community') }}
|
||||||
<th>Retention</th>
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'title DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'title ASC' }}"></span>
|
||||||
<th>Layout</th>
|
</button>
|
||||||
<th title="{{ _('Posts can be popular.') }}">Popular</th>
|
</th>
|
||||||
<th title="{{ _('Posts show in the All feed.') }}">All</th>
|
<th>
|
||||||
<th title="{{ _('Content warning, NSFW or NSFL set for community.') }}">Warning</th>
|
<button form="searchCommunities" name="sort_by" value="topic_id{{' ASC' if sort_by == 'topic_id DESC' else ' DESC' }}" class="btn" title="{{ _('Topic') }}">
|
||||||
<th>Actions</th>
|
{{ _('Topic') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'topic_id ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'topic_id DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="post_count{{' ASC' if sort_by == 'post_count DESC' else ' DESC' }}" class="btn" title="{{ _('Sort by post count') }}">
|
||||||
|
{{ _('Posts') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'post_count ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'post_count DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="subscriptions_count{{' ASC' if sort_by == 'subscriptions_count DESC' else ' DESC' }}" class="btn" title="{{ _('Number of known subscribers') }}">
|
||||||
|
{{ _('Members') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'subscriptions_count ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'subscriptions_count DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="content_retention{{' ASC' if sort_by == 'content_retention DESC' else ' DESC' }}" class="btn" title="{{ _('Content retention duration') }}">
|
||||||
|
{{ _('Retention') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'content_retention ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'content_retention DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>{{ _('Layout') }}</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="show_popular{{' ASC' if sort_by == 'show_popular DESC' else ' DESC' }}" class="btn" title="{{ _('Posts can be popular.') }}">
|
||||||
|
{{ _('Popular') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'show_popular ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'show_popular DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="show_all{{' ASC' if sort_by == 'show_all DESC' else ' DESC' }}" class="btn" title="{{ _('Posts show in the All feed.') }}">
|
||||||
|
{{ _('All') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'show_all ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'show_all DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="{{'nsfl ASC, nsfw ASC' if sort_by == 'nsfl DESC, nsfw DESC' else 'nsfl DESC, nsfw DESC' }}" class="btn" title="{{ _('Content warning, NSFW or NSFL set for community.') }}">
|
||||||
|
{{ _('Warning') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'nsfl ASC, nsfw ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'nsfl DESC, nsfw DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchCommunities" name="sort_by" value="last_active{{' ASC' if sort_by == 'last_active DESC' else ' DESC' }}" class="btn" title="{{ _('Sort by recent activity') }}">
|
||||||
|
{{ _('Active') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_active ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'last_active DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>{{ _('Actions') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for community in communities.items %}
|
{% for community in communities.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ render_communityname(community, add_domain=False) }}{% if community.banned %} (banned){% endif %}<br />
|
<td>{{ render_communityname(community, add_domain=False) }}{% if community.banned %} (banned){% endif %}<br />
|
||||||
!<a href="/c/{{ community.link() }}">{{ community.name }}</a><wbr />@<a href="{{ community.ap_profile_id }}">{{ community.ap_domain }}</a></td>
|
!<a href="/c/{{ community.link() }}">{{ community.name }}</a><wbr />@<a href="{{ community.ap_profile_id }}">{{ community.ap_domain }}</a></td>
|
||||||
<td>{{ community.topic.name }}</td>
|
<td><span title="{{ _('Topic') }}">{{ community.topic.name }}</span></td>
|
||||||
<td>{{ community.post_count }}</td>
|
<td><span title="{{ _('Number of posts') }}">{{ community.post_count }}</span></td>
|
||||||
<td>{{ community.content_retention if community.content_retention != -1 }}</td>
|
<td><span title="{{ _('Number of known subscribers') }}">{{ community.subscriptions_count }}</span></td>
|
||||||
<td>{{ community.default_layout if community.default_layout }}</td>
|
<td><span title="{{ _('Content retention duration') }}">{{ community.content_retention if community.content_retention != -1 }}</span></td>
|
||||||
<th>{{ '✓'|safe if community.show_popular else '✗'|safe }}</th>
|
<td><span title="{{ _('Layout') }}">{{ community.default_layout if community.default_layout }}</span></td>
|
||||||
<th>{{ '✓'|safe if community.show_all else '✗'|safe }}</th>
|
<td><span title="{{ _('Posts can be popular.') }}">{{ '✓'|safe if community.show_popular else '✗'|safe }}</span></td>
|
||||||
<th>{{ '⚠'|safe if community.nsfw or community.nsfl or community.content_warning else ''|safe }}</th>
|
<td><span title="{{ _('Posts show in the All feed.') }}">{{ '✓'|safe if community.show_all else '✗'|safe }}</span></td>
|
||||||
<td><a href="{{ url_for('admin.admin_community_edit', community_id=community.id) }}">Edit</a> |
|
<td><span title="{{ _('Content warning, NSFW or NSFL set for community.') }}">{{ '⚠'|safe if community.nsfw or community.nsfl or community.content_warning else ''|safe }}</span></td>
|
||||||
<a href="{{ url_for('admin.admin_community_delete', community_id=community.id) }}" class="confirm_first">Delete</a>
|
<td><span title="{{ _('Last activity') }}: {{ community.last_active }}">{{ arrow.get(community.last_active).humanize(locale=locale) }}</span></td>
|
||||||
|
<td><a href="{{ url_for('admin.admin_community_edit', community_id=community.id) }}">{{ _('Edit') }}</a>,
|
||||||
|
<a href="{{ url_for('community.community_moderate', actor=community.link()) }}">{{ _('Moderate') }}</a>,
|
||||||
|
<a href="{{ url_for('admin.admin_community_delete', community_id=community.id) }}" class="confirm_first">{{ _('Delete') }}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
<nav aria-label="Pagination" class="mt-4" role="navigation">
|
<nav aria-label="Pagination" class="mt-4" role="navigation">
|
||||||
{% if prev_url %}
|
{% if prev_url %}
|
||||||
<a href="{{ prev_url }}" class="btn btn-primary">
|
<a href="{{ prev_url }}" class="btn btn-primary">
|
||||||
|
|
|
@ -10,8 +10,9 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
<form method="get">
|
<form id="searchInstances" method="get">
|
||||||
<input type="search" name="search"> <input type="submit" name="submit" value="Search">
|
<input type="search" name="search" placeholder="{{ _('Search') }}" value="{{ search }}">
|
||||||
|
<input type="submit" name="submit" value="{{ _('Search') }}">
|
||||||
</form>
|
</form>
|
||||||
Status Filter:
|
Status Filter:
|
||||||
<a href="{{ url_for('admin.admin_instances', filter='online') }}">{{ _('Online') }}</a> |
|
<a href="{{ url_for('admin.admin_instances', filter='online') }}">{{ _('Online') }}</a> |
|
||||||
|
@ -21,41 +22,86 @@
|
||||||
<a href="{{ url_for('admin.admin_instances', filter='blocked') }}">{{ _('Blocked') }}</a>
|
<a href="{{ url_for('admin.admin_instances', filter='blocked') }}">{{ _('Blocked') }}</a>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ _('Domain') }}</th>
|
<th>
|
||||||
<th>{{ _('Software') }}</th>
|
<button form="searchInstances" name="sort_by" value="domain{{' DESC' if sort_by == 'domain ASC' else ' ASC' }}" class="btn" title="{{ _('Domain') }}">
|
||||||
<th>{{ _('Version') }}</th>
|
{{ _('Domain') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'domain DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'domain ASC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="software{{' DESC' if sort_by == 'software ASC' else ' ASC' }}" class="btn" title="{{ _('Software') }}">
|
||||||
|
{{ _('Software') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'software DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'software ASC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="version{{' DESC' if sort_by == 'version ASC' else ' ASC' }}" class="btn" title="{{ _('Version') }}">
|
||||||
|
{{ _('Version') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'version DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'version ASC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
<th title="{{ _('Known Communities') }}">{{ _('Communities') }}</th>
|
<th title="{{ _('Known Communities') }}">{{ _('Communities') }}</th>
|
||||||
<th title="{{ _('Known Users') }}">{{ _('Users') }}</th>
|
<th title="{{ _('Known Users') }}">{{ _('Users') }}</th>
|
||||||
<th>{{ _('Posts') }}</th>
|
<th>{{ _('Posts') }}</th>
|
||||||
<th>{{ _('Post Replies') }}</th>
|
<th>{{ _('Post Replies') }}</th>
|
||||||
<th>{{ _('Vote Weight') }}</th>
|
<th>
|
||||||
<th>{{ _('Trusted') }}</th>
|
<button form="searchInstances" name="sort_by" value="vote_weight{{' ASC' if sort_by == 'vote_weight DESC' else ' DESC' }}" class="btn" title="{{ _('Vote Weight') }}">
|
||||||
<th title="{{ _('When an Activity was received from them') }}">{{ _('Seen') }}</th>
|
{{ _('Vote Weight') }}
|
||||||
<th title="{{ _('When we successfully sent them an Activity') }}">{{ _('Sent') }}</th>
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'vote_weight ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'vote_weight DESC' }}"></span>
|
||||||
<th title="{{ _('How many times we failed to send (reset to 0 after every successful send)') }}">{{ _('Failed') }}</th>
|
</button>
|
||||||
<th title="{{ _('Instance Status - Online/Dormant/Gone Forever') }}">{{ _('Status') }}</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="trusted{{' ASC' if sort_by == 'trusted DESC' else ' DESC' }}" class="btn" title="{{ _('Trusted') }}">
|
||||||
|
{{ _('Trusted') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'trusted ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'trusted DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="last_seen{{' ASC' if sort_by == 'last_seen DESC' else ' DESC' }}" class="btn" title="{{ _('When an Activity was received from them') }}">
|
||||||
|
{{ _('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>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="last_successful_send{{' ASC' if sort_by == 'last_successful_send DESC' else ' DESC' }}" class="btn" title="{{ _('When we successfully sent them an Activity') }}">
|
||||||
|
{{ _('Sent') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'last_successful_send ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'last_successful_send DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="failures{{' ASC' if sort_by == 'failures DESC' else ' DESC' }}" class="btn" title="{{ _('How many times we failed to send (reset to 0 after every successful send)') }}">
|
||||||
|
{{ _('Failed') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'failures ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'failures DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<button form="searchInstances" name="sort_by" value="{{'gone_forever ASC, dormant ASC' if sort_by == 'gone_forever DESC, dormant DESC' else 'gone_forever DESC, dormant DESC' }}" class="btn" title="{{ _('Instance Status - Online/Dormant/Gone Forever') }}">
|
||||||
|
{{ _('Status') }}
|
||||||
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'gone_forever ASC, dormant ASC' }}{{ 'fe fe-chevron-down' if sort_by == 'gone_forever DESC, dormant DESC' }}"></span>
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for instance in instances.items %}
|
{% for instance in instances.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="https://{{ instance.domain }}" rel="noopener nofollow noindex noreferrer">{{ instance.domain }}</a></td>
|
<td><span title="{{ _('Domain') }}"><a href="https://{{ instance.domain }}" rel="noopener nofollow noindex noreferrer">{{ instance.domain }}</a></span></td>
|
||||||
<td>{{ instance.software }}</td>
|
<td><span title="{{ _('Software') }}">{{ instance.software }}</span></td>
|
||||||
<td>{{ instance.version if instance.version }}</td>
|
<td><span title="{{ _('Version') }}">{{ instance.version if instance.version }}</span></td>
|
||||||
<td>{{ instance.known_communities_count() }}</td>
|
<td><span title="{{ _('Known Communities') }}">{{ instance.known_communities_count() }}</span></td>
|
||||||
<td>{{ instance.known_users_count() }}</td>
|
<td><span title="{{ _('Known Users') }}">{{ instance.known_users_count() }}</span></td>
|
||||||
<td>{{ instance.post_count() }}</td>
|
<td><span title="{{ _('Posts') }}">{{ instance.post_count() }}</span></td>
|
||||||
<td>{{ instance.post_replies_count() }}</td>
|
<td><span title="{{ _('Post Replies') }}">{{ instance.post_replies_count() }}</span></td>
|
||||||
<td>{{ instance.vote_weight }}</td>
|
<td><span title="{{ _('Vote Weight') }}">{{ instance.vote_weight }}</span></td>
|
||||||
<td>{{ _('Yes') if instance.trusted }}</td>
|
<td><span title="{{ _('Trusted') }}">{{ _('Yes') if instance.trusted }}</span></td>
|
||||||
<td>{{ arrow.get(instance.last_seen).humanize(locale=locale) if instance.last_seen }}</td>
|
<td><span title="{{ _('Last Seen') }}: {{ instance.last_seen }}">{{ arrow.get(instance.last_seen).humanize(locale=locale) if instance.last_seen }}</span></td>
|
||||||
<td>{{ arrow.get(instance.last_successful_send).humanize(locale=locale) if instance.last_successful_send }}</td>
|
<td><span title="{{ _('Sent') }}">{{ arrow.get(instance.last_successful_send).humanize(locale=locale) if instance.last_successful_send }}</span></td>
|
||||||
<td>{{ instance.failures }}</td>
|
<td><span title="{{ _('Failed') }}">{{ instance.failures }}</span></td>
|
||||||
{% if instance.gone_forever %}
|
{% if instance.gone_forever %}
|
||||||
<td>{{ _('Gone forever') }}</td>
|
<td><span title="{{ _('Status') }}">{{ _('Gone forever') }}</span></td>
|
||||||
{% elif instance.dormant %}
|
{% elif instance.dormant %}
|
||||||
<td>{{ _('Dormant') }}</td>
|
<td><span title="{{ _('Status') }}">{{ _('Dormant') }}</span></td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>{{ _('Online') }}</td>
|
<td><span title="{{ _('Status') }}">{{ _('Online') }}</span></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td><a href="{{ url_for('admin.admin_instance_edit', instance_id=instance.id) }}">{{ _('Edit') }}</a></td>
|
<td><a href="{{ url_for('admin.admin_instance_edit', instance_id=instance.id) }}">{{ _('Edit') }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -42,7 +42,12 @@
|
||||||
<span class="{{ 'fe fe-chevron-up' if sort_by == 'user_name DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'user_name ASC' }}"></span>
|
<span class="{{ 'fe fe-chevron-up' if sort_by == 'user_name DESC' }}{{ 'fe fe-chevron-down' if sort_by == 'user_name ASC' }}"></span>
|
||||||
</button>
|
</button>
|
||||||
</th>
|
</th>
|
||||||
<th>{{ _('Banned') }}</th>
|
<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>
|
||||||
<th>
|
<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.') }}">
|
<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') }}
|
{{ _('Reports') }}
|
||||||
|
@ -71,15 +76,15 @@
|
||||||
</tr>
|
</tr>
|
||||||
{% for user in users.items %}
|
{% for user in users.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ render_username(user, add_domain=False) }}<br />
|
<td><span title="{{ _('Name') }}">{{ render_username(user, add_domain=False) }}<br />
|
||||||
<a href="/u/{{ user.link() }}">{{ user.user_name }}</a>{% if not user.is_local() %}<wbr />@<a href="{{ user.ap_profile_id }}">{{ user.ap_domain }}</a>{% endif %}</td>
|
<a href="/u/{{ user.link() }}">{{ user.user_name }}</a>{% if not user.is_local() %}<wbr />@<a href="{{ user.ap_profile_id }}">{{ user.ap_domain }}</a>{% endif %}</span></td>
|
||||||
<td>{{ '<span class="red">Banned</span>'|safe if user.banned }}
|
<td><span title="{{ _('Banned') }}">{{ '<span class="red">Banned</span>'|safe if user.banned }}
|
||||||
{{ '<span class="red">Banned posts</span>'|safe if user.ban_posts }}
|
{{ '<span class="red">Banned posts</span>'|safe if user.ban_posts }}
|
||||||
{{ '<span class="red">Banned comments</span>'|safe if user.ban_comments }}</td>
|
{{ '<span class="red">Banned comments</span>'|safe if user.ban_comments }}</span></td>
|
||||||
<td>{{ user.reports if user.reports > 0 }} </td>
|
<td><span title="{{ _('Reports') }}">{{ user.reports if user.reports > 0 }}</span></td>
|
||||||
<td>{% if user.attitude != 1 %}{{ (user.attitude * 100) | round | int }}%{% endif %}</td>
|
<td><span title="{{ _('Attitude') }}">{% if user.attitude != 1 %}{{ (user.attitude * 100) | round | int }}%{% endif %}</span></td>
|
||||||
<td>{% if user.reputation %}R {{ user.reputation | round | int }}{% endif %}</td>
|
<td><span title="{{ _('Reputation') }}">{% if user.reputation %}R {{ user.reputation | round | int }}{% endif %}</span></td>
|
||||||
<td><span title="{{ user.last_seen }}">{{ arrow.get(user.last_seen).humanize(locale=locale) }}</span></td>
|
<td><span title="{{ _('Last Seen') }}: {{ user.last_seen }}">{{ arrow.get(user.last_seen).humanize(locale=locale) }}</span></td>
|
||||||
<td><a href="{{ url_for('admin.admin_user_edit', user_id=user.id) }}">Edit</a>,
|
<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>,
|
<a href="{{ url_for('admin.admin_user_delete', user_id=user.id) }}" class="confirm_first">Delete</a>,
|
||||||
<br />
|
<br />
|
||||||
|
|
Loading…
Add table
Reference in a new issue