From 12567f6891ad591390cbd74c0e7b77a4a024a24e Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 16 Dec 2022 19:42:48 -0700 Subject: Identity admin/moderation --- templates/admin/identities.html | 49 ++++++++++++++- templates/admin/identity_edit.html | 123 +++++++++++++++++++++++++++++++++++++ templates/admin/stator.html | 16 ++++- templates/admin/user_edit.html | 2 +- 4 files changed, 184 insertions(+), 6 deletions(-) create mode 100644 templates/admin/identity_edit.html (limited to 'templates/admin') 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 %} -

- Please use the Django Admin for now. -

+ +
+ {% if local_only %} + Local Only + {% else %} + Local Only + {% endif %} +
+
+ {% for identity in page_obj %} + + Avatar for {{ identity.name_or_handle }} + + {{ identity.html_name_or_handle }} + + {{ identity.handle }} + + + {% if identity.banned %} + Banned + {% endif %} + + {% empty %} +

+ {% if query %} + No identities match your query. + {% else %} + There are no identities yet. + {% endif %} +

+ {% endfor %} +
+ {% if page_obj.has_previous %} + Previous Page + {% endif %} + {% if page_obj.has_next %} + Next Page + {% endif %} +
+
{% 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 %} +

{{ identity.html_name_or_handle }} {{ identity.handle }}

+
+ {% csrf_token %} +
+ Stats + + + + + {% if identity.local %} + + + + + + + + + + {% else %} + + + + + + + + + + {% endif %} + + + + + + + +
+ {% if identity.local %} +
+ Users +

+ {% for user in identity.users.all %} + {{ user.email }}{% if not forloop.last %}, {% endif %} + {% endfor %} +

+
+ {% endif %} +
+ Technical + + {% if not identity.local %} + + + + {% if identity.state == "outdated" %} + + + + {% endif %} + {% endif %} + + + + {% if not identity.local %} + + + + {% endif %} + +
+
+ Admin Notes + {% include "forms/_field.html" with field=form.notes %} +
+
+ {% if not identity.local %} +
+
+ Back + View Profile + +
+
+{% 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 %}
{{ model }} -

Pending: {{ stats.most_recent_queued }}

-

Processed today: {{ stats.most_recent_handled.1 }}

+ + + + + + + + + + +
Pending + {{ stats.most_recent_queued }}
Processed today + {{ stats.most_recent_handled.1 }}
This month + {{ stats.most_recent_handled.2 }}
{% 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 %}

{{ editing_user.email }}

-- cgit v1.2.3