view links for admin tables

This commit is contained in:
Hendrik L 2024-06-29 19:43:09 +02:00
parent 13aee865d9
commit 4ad4385f66
4 changed files with 14 additions and 12 deletions

View file

@ -27,17 +27,17 @@
</tr> </tr>
{% for community in communities.items %} {% for community in communities.items %}
<tr> <tr>
<td>{{ community.name }}</td> <td><a href="/c/{{ community.link() }}">{{ community.name }}</a></td>
<td><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" /> <td><a href="/c/{{ community.link() }}">
{{ community.display_name() }}{% if community.banned %} (banned){% endif %}</td> <img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" />
{{ community.display_name() }}{% if community.banned %} (banned){% endif %}</a></td>
<td>{{ community.topic.name }}</td> <td>{{ community.topic.name }}</td>
<td>{{ community.post_count }}</td> <td>{{ community.post_count }}</td>
<th>{{ '&check;'|safe if community.show_home else '&cross;'|safe }}</th> <th>{{ '&check;'|safe if community.show_home else '&cross;'|safe }}</th>
<th>{{ '&check;'|safe if community.show_popular else '&cross;'|safe }}</th> <th>{{ '&check;'|safe if community.show_popular else '&cross;'|safe }}</th>
<th>{{ '&check;'|safe if community.show_all else '&cross;'|safe }}</th> <th>{{ '&check;'|safe if community.show_all else '&cross;'|safe }}</th>
<th>{{ '&#x26A0;'|safe if community.nsfw or community.nsfl or community.content_warning else ''|safe }}</th> <th>{{ '&#x26A0;'|safe if community.nsfw or community.nsfl or community.content_warning else ''|safe }}</th>
<td><a href="/c/{{ community.link() }}">View</a> | <td><a href="{{ url_for('admin.admin_community_edit', community_id=community.id) }}">Edit</a> |
<a href="{{ url_for('admin.admin_community_edit', community_id=community.id) }}">Edit</a> |
<a href="{{ url_for('admin.admin_community_delete', community_id=community.id) }}" class="confirm_first">Delete</a> <a href="{{ url_for('admin.admin_community_delete', community_id=community.id) }}" class="confirm_first">Delete</a>
</td> </td>
</tr> </tr>

View file

@ -9,7 +9,7 @@
{% block app_content %} {% block app_content %}
{% macro render_topic(topic, depth) %} {% macro render_topic(topic, depth) %}
<tr> <tr>
<td nowrap="nowrap">{{ '--' * depth }} {{ topic['topic'].name }}</td> <td nowrap="nowrap">{{ '--' * depth }} <a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a></td>
<td>{{ topic['topic'].num_communities }}</td> <td>{{ topic['topic'].num_communities }}</td>
<td><a href="{{ url_for('admin.admin_topic_edit', topic_id=topic['topic'].id) }}">Edit</a> | <td><a href="{{ url_for('admin.admin_topic_edit', topic_id=topic['topic'].id) }}">Edit</a> |
{% if topic['topic'].num_communities == 0 %} {% if topic['topic'].num_communities == 0 %}

View file

@ -32,9 +32,10 @@
</tr> </tr>
{% for user in users.items %} {% for user in users.items %}
<tr> <tr>
<td><img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" /> <td><a href="/u/{{ user.link() }}">
{{ user.display_name() }}</td> <img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
<td>{{ 'Local' if user.is_local() else 'Remote' }}</td> {{ user.display_name() }}</a></td>
<td>{% if user.is_local() %}Local{% else %}<a href="{{ user.ap_profile_id }}">Remote</a>{% endif %}</td>
<td>{% if request.args.get('local_remote', '') == 'local' %} <td>{% if request.args.get('local_remote', '') == 'local' %}
{{ moment(user.last_seen).fromNow() }} {{ moment(user.last_seen).fromNow() }}
{% else %} {% else %}

View file

@ -34,9 +34,10 @@
</tr> </tr>
{% for user in users.items %} {% for user in users.items %}
<tr> <tr>
<td><img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" /> <td><a href="/u/{{ user.link() }}">
{{ user.display_name() }}</td> <img src="{{ user.avatar_thumbnail() }}" class="community_icon rounded-circle" loading="lazy" />
<td>{{ 'Local' if user.is_local() else 'Remote' }}</td> {{ user.display_name() }}</a></td>
<td>{% if user.is_local() %}Local{% else %}<a href="{{ user.ap_profile_id }}">Remote</a>{% endif %}</td>
<td>{% if request.args.get('local_remote', '') == 'local' %} <td>{% if request.args.get('local_remote', '') == 'local' %}
{{ moment(user.last_seen).fromNow() }} {{ moment(user.last_seen).fromNow() }}
{% else %} {% else %}