summaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorAndrew Godwin2022-12-16 19:42:48 -0700
committerAndrew Godwin2022-12-16 19:42:48 -0700
commit12567f6891ad591390cbd74c0e7b77a4a024a24e (patch)
tree39a6bab590d3f1bde3802854d4a1175780404276 /templates/admin
parentc588567c8698700cd347d9b8f884a7967890aa58 (diff)
downloadtakahe-12567f6891ad591390cbd74c0e7b77a4a024a24e.tar.gz
takahe-12567f6891ad591390cbd74c0e7b77a4a024a24e.tar.bz2
takahe-12567f6891ad591390cbd74c0e7b77a4a024a24e.zip
Identity admin/moderation
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/identities.html49
-rw-r--r--templates/admin/identity_edit.html123
-rw-r--r--templates/admin/stator.html16
-rw-r--r--templates/admin/user_edit.html2
4 files changed, 184 insertions, 6 deletions
diff --git a/templates/admin/identities.html b/templates/admin/identities.html
index 556e915..9e30e39 100644
--- a/templates/admin/identities.html
+++ b/templates/admin/identities.html
@@ -3,7 +3,50 @@
{% block subtitle %}Identities{% endblock %}
{% block content %}
- <p>
- Please use the <a href="/djadmin/users/identity/">Django Admin</a> for now.
- </p>
+ <form action="." class="search">
+ <input type="search" name="query" value="{{ query }}" placeholder="Search by name/username">
+ {% if local_only %}
+ <input type="hidden" name="local_only" value="true">
+ {% endif %}
+ <button><i class="fa-solid fa-search"></i></button>
+ </form>
+ <div class="view-options">
+ {% if local_only %}
+ <a href=".?{% if query %}query={{ query }}{% endif %}" class="selected"><i class="fa-solid fa-check"></i> Local Only</a>
+ {% else %}
+ <a href=".?local_only=true{% if query %}&amp;query={{ query }}{% endif %}"><i class="fa-solid fa-xmark"></i> Local Only</a>
+ {% endif %}
+ </div>
+ <section class="icon-menu">
+ {% for identity in page_obj %}
+ <a class="option" href="{{ identity.urls.admin_edit }}">
+ <img src="{{ identity.local_icon_url.relative }}" class="icon" alt="Avatar for {{ identity.name_or_handle }}">
+ <span class="handle">
+ {{ identity.html_name_or_handle }}
+ <small>
+ {{ identity.handle }}
+ </small>
+ </span>
+ {% if identity.banned %}
+ <span class="pill bad">Banned</span>
+ {% endif %}
+ </a>
+ {% empty %}
+ <p class="option empty">
+ {% if query %}
+ No identities match your query.
+ {% else %}
+ There are no identities yet.
+ {% endif %}
+ </p>
+ {% endfor %}
+ <div class="load-more">
+ {% if page_obj.has_previous %}
+ <a class="button" href=".?page={{ page_obj.previous_page_number }}{% if local_only %}&amp;local_only=true{% endif %}{% if query %}&amp;query={{ query }}{% endif %}">Previous Page</a>
+ {% endif %}
+ {% if page_obj.has_next %}
+ <a class="button" href=".?page={{ page_obj.next_page_number }}{% if local_only %}&amp;local_only=true{% endif %}{% if query %}&amp;query={{ query }}{% endif %}">Next Page</a>
+ {% endif %}
+ </div>
+ </section>
{% endblock %}
diff --git a/templates/admin/identity_edit.html b/templates/admin/identity_edit.html
new file mode 100644
index 0000000..c093b7a
--- /dev/null
+++ b/templates/admin/identity_edit.html
@@ -0,0 +1,123 @@
+{% extends "settings/base.html" %}
+
+{% block subtitle %}{{ identity.name_or_handle }}{% endblock %}
+
+{% block content %}
+ <h1>{{ identity.html_name_or_handle }} <small>{{ identity.handle }}</small></h1>
+ <form action="." method="POST">
+ {% csrf_token %}
+ <fieldset>
+ <legend>Stats</legend>
+ <table class="metadata">
+ <tr>
+ <th>Status</td>
+ <td>
+ {% if identity.limited %}
+ Limited
+ {% elif identity.blocked %}
+ Blocked
+ {% else %}
+ Normal
+ {% endif %}
+ </td>
+ </tr>
+ {% if identity.local %}
+ <tr>
+ <th>Type</td>
+ <td>Local Identity</td>
+ </tr>
+ <tr>
+ <th>Followers</td>
+ <td>{{ identity.inbound_follows.count }}</td>
+ </tr>
+ <tr>
+ <th>Following</td>
+ <td>{{ identity.outbound_follows.count }}</td>
+ </tr>
+ {% else %}
+ <tr>
+ <th>Type</td>
+ <td>Remote Identity</td>
+ </tr>
+ <tr>
+ <th>Local Followers</td>
+ <td>{{ identity.inbound_follows.count }}</td>
+ </tr>
+ <tr>
+ <th>Following Locals</td>
+ <td>{{ identity.outbound_follows.count }}</td>
+ </tr>
+ {% endif %}
+ <tr>
+ <th>Posts</td>
+ <td>{{ identity.posts.count }}</td>
+ </tr>
+ <tr>
+ <th>First Seen</td>
+ <td>{{ identity.created|timesince }} ago</td>
+ </tr>
+ </table>
+ </fieldset>
+ {% if identity.local %}
+ <fieldset>
+ <legend>Users</legend>
+ <p>
+ {% for user in identity.users.all %}
+ <a href="{{ user.urls.admin_edit }}">{{ user.email }}</a>{% if not forloop.last %}, {% endif %}
+ {% endfor %}
+ </p>
+ </fieldset>
+ {% endif %}
+ <fieldset>
+ <legend>Technical</legend>
+ <table class="metadata">
+ {% if not identity.local %}
+ <tr>
+ <th>Last Fetched</td>
+ <td>{{ identity.fetched|timesince }} ago</td>
+ </tr>
+ {% if identity.state == "outdated" %}
+ <tr>
+ <th>Attempting Fetch Since</td>
+ <td>{{ identity.state_changed|timesince }} ago</td>
+ </tr>
+ {% endif %}
+ {% endif %}
+ <tr>
+ <th>Actor URI</td>
+ <td>{{ identity.actor_uri }}</td>
+ </tr>
+ {% if not identity.local %}
+ <tr>
+ <th>Inbox URI</td>
+ <td>{{ identity.inbox_uri }}</td>
+ </tr>
+ {% endif %}
+ </table>
+ </fieldset>
+ <fieldset>
+ <legend>Admin Notes</legend>
+ {% include "forms/_field.html" with field=form.notes %}
+ </fieldset>
+ <div class="buttons">
+ {% if not identity.local %}
+ <button class="left" name="fetch">Force Fetch</a>
+ {% endif %}
+ {% if identity.limited %}
+ <button class="left delete" name="unlimit">Unlimit</a>
+ {% else %}
+ <button class="left delete" name="limit">Limit</a>
+ {% endif %}
+ {% if identity.blocked %}
+ <button class="left delete" name="unblock">Unblock</a>
+ {% else %}
+ <button class="left delete" name="block">Block</a>
+ {% endif %}
+ </div>
+ <div class="buttons">
+ <a href="{{ identity.urls.admin }}" class="button secondary left">Back</a>
+ <a href="{{ identity.urls.view }}" class="button secondary">View Profile</a>
+ <button>Save Notes</button>
+ </div>
+ </form>
+{% endblock %}
diff --git a/templates/admin/stator.html b/templates/admin/stator.html
index 64bd432..1f64eda 100644
--- a/templates/admin/stator.html
+++ b/templates/admin/stator.html
@@ -6,8 +6,20 @@
{% for model, stats in model_stats.items %}
<fieldset>
<legend>{{ model }}</legend>
- <p><b>Pending:</b> {{ stats.most_recent_queued }}</p>
- <p><b>Processed today:</b> {{ stats.most_recent_handled.1 }}</p>
+ <table class="metadata">
+ <tr>
+ <th>Pending</td>
+ <td>{{ stats.most_recent_queued }}</td>
+ </tr>
+ <tr>
+ <th>Processed today</td>
+ <td>{{ stats.most_recent_handled.1 }}</td>
+ </tr>
+ <tr>
+ <th>This month</td>
+ <td>{{ stats.most_recent_handled.2 }}</td>
+ </tr>
+ </table>
</fieldset>
{% endfor %}
{% endblock %}
diff --git a/templates/admin/user_edit.html b/templates/admin/user_edit.html
index b795848..45be8d9 100644
--- a/templates/admin/user_edit.html
+++ b/templates/admin/user_edit.html
@@ -1,6 +1,6 @@
{% extends "settings/base.html" %}
-{% block subtitle %}{{ user.email }}{% endblock %}
+{% block subtitle %}{{ editing_user.email }}{% endblock %}
{% block content %}
<h1>{{ editing_user.email }}</h1>