mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Merge pull request 'Rework columns in admin views of users and communities' (#359) from h3ndrik/pyfedi:adminviews into main
Reviewed-on: https://codeberg.org/rimu/pyfedi/pulls/359
This commit is contained in:
commit
9924306fbe
4 changed files with 12 additions and 31 deletions
|
@ -19,7 +19,6 @@
|
|||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Title</th>
|
||||
<th>Topic</th>
|
||||
<th># Posts</th>
|
||||
<th>Retention</th>
|
||||
|
@ -32,8 +31,8 @@
|
|||
</tr>
|
||||
{% for community in communities.items %}
|
||||
<tr>
|
||||
<td><a href="/c/{{ community.link() }}">{{ community.name }}</a></td>
|
||||
<td>{{ render_communityname(community) }}{% if community.banned %} (banned){% endif %}</td>
|
||||
<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>
|
||||
<td>{{ community.topic.name }}</td>
|
||||
<td>{{ community.post_count }}</td>
|
||||
<td>{{ community.content_retention if community.content_retention != -1 }}</td>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
<table class="table table-striped mt-1">
|
||||
<tr>
|
||||
<th title="{{ _('Display name.') }}">{{ _('Name') }}</th>
|
||||
<th>{{ _('Local/Remote') }}</th>
|
||||
<th title="{{ _('Last seen.') }}">{{ _('Seen') }}</th>
|
||||
<th title="{{ _('Attitude: Percentage of up votes vs. down votes the account made.') }}">{{ _('Attitude') }}</th>
|
||||
<th title="{{ _('Reputation: The Karma of the account. Total up votes minus down votes they got.') }}">{{ _('Reputation') }}</th>
|
||||
|
@ -32,10 +31,8 @@
|
|||
</tr>
|
||||
{% for user in users.items %}
|
||||
<tr>
|
||||
<td><a href="/u/{{ user.link() }}">
|
||||
<img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ user.display_name() }}</a></td>
|
||||
<td>{% if user.is_local() %}Local{% else %}<a href="{{ user.ap_profile_id }}">Remote</a>{% endif %}</td>
|
||||
<td>{{ 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>
|
||||
<td>{% if request.args.get('local_remote', '') == 'local' %}
|
||||
{{ arrow.get(user.last_seen).humanize(locale=locale) }}
|
||||
{% else %}
|
||||
|
@ -48,13 +45,7 @@
|
|||
<td>{{ user.reports if user.reports > 0 }} </td>
|
||||
<td>{{ user.ip_address if user.ip_address }}<br />{{ user.ip_address_country if user.ip_address_country }}</td>
|
||||
<td>{{ user.referrer if user.referrer }} </td>
|
||||
<td><a href="/u/{{ user.link() }}">View local</a> |
|
||||
{% if not user.is_local() %}
|
||||
<a href="{{ user.ap_profile_id }}">View remote</a> |
|
||||
{% else %}
|
||||
View remote |
|
||||
{% endif %}
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<table class="table table-striped mt-1">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Local/Remote</th>
|
||||
<th>Seen</th>
|
||||
<th>Attitude</th>
|
||||
<th>Rep</th>
|
||||
|
@ -34,10 +33,8 @@
|
|||
</tr>
|
||||
{% for user in users.items %}
|
||||
<tr>
|
||||
<td><a href="/u/{{ user.link() }}">
|
||||
<img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
|
||||
{{ user.display_name() }}</a></td>
|
||||
<td>{% if user.is_local() %}Local{% else %}<a href="{{ user.ap_profile_id }}">Remote</a>{% endif %}</td>
|
||||
<td>{{ 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>
|
||||
<td>{% if request.args.get('local_remote', '') == 'local' %}
|
||||
{{ arrow.get(user.last_seen).humanize(locale=locale) }}
|
||||
{% else %}
|
||||
|
@ -50,13 +47,7 @@
|
|||
<td>{{ user.reports if user.reports > 0 }} </td>
|
||||
<td>{{ user.ip_address if user.ip_address }} </td>
|
||||
<td>{{ user.referrer if user.referrer }} </td>
|
||||
<td><a href="/u/{{ user.link() }}">View local</a> |
|
||||
{% if not user.is_local() %}
|
||||
<a href="{{ user.ap_profile_id }}">View remote</a> |
|
||||
{% else %}
|
||||
View remote |
|
||||
{% endif %}
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% macro render_username(user) -%}
|
||||
{% macro render_username(user, add_domain=True) -%}
|
||||
<span class="render_username">
|
||||
{% if user.deleted -%}
|
||||
[deleted]
|
||||
|
@ -7,7 +7,7 @@
|
|||
{% if user.avatar_id and not low_bandwidth and not collapsed -%}
|
||||
<img src="{{ user.avatar_thumbnail() }}" alt="" loading="lazy" />
|
||||
{% endif -%}
|
||||
{{ user.display_name() }}{% if not user.is_local() %}<span class="text-muted">@{{ user.ap_domain }}</span>{% endif %}
|
||||
{{ user.display_name() }}{% if add_domain and not user.is_local() %}<span class="text-muted">@{{ user.ap_domain }}</span>{% endif %}
|
||||
</a>
|
||||
{% if user.created_recently() -%}
|
||||
<span class="fe fe-new-account" title="New account"> </span>
|
||||
|
@ -26,13 +26,13 @@
|
|||
{% endif -%}
|
||||
</span>
|
||||
{% endmacro -%}
|
||||
{% macro render_communityname(community) -%}
|
||||
{% macro render_communityname(community, add_domain=True) -%}
|
||||
<span class="render_community">
|
||||
<a href="/c/{{ community.link() }}" aria-label="{{ _('Go to community %(name)s', name=community.name) }}">
|
||||
{% if community.icon_id and not low_bandwidth and not collapsed -%}
|
||||
<img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" alt="" loading="lazy" />
|
||||
{% endif -%}
|
||||
c/{{ community.display_name() }}
|
||||
{{ community.title }}{% if add_domain and not community.is_local() %}<span class="text-muted">@{{ community.ap_domain }}</span>{% endif %}
|
||||
</a>
|
||||
</span>
|
||||
{% endmacro -%}
|
||||
|
|
Loading…
Add table
Reference in a new issue