From e8d6dccbb27a8611311b5f94f593b69bcca99528 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 17 Dec 2022 14:45:31 -0700 Subject: Report function and admin --- templates/activities/_post.html | 3 ++ templates/admin/report_view.html | 84 ++++++++++++++++++++++++++++++++++++++++ templates/admin/reports.html | 43 ++++++++++++++++++++ templates/settings/_menu.html | 4 +- templates/users/report.html | 27 +++++++++++++ templates/users/report_sent.html | 13 +++++++ 6 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 templates/admin/report_view.html create mode 100644 templates/admin/reports.html create mode 100644 templates/users/report.html create mode 100644 templates/users/report_sent.html (limited to 'templates') diff --git a/templates/activities/_post.html b/templates/activities/_post.html index 5d75b78..990e457 100644 --- a/templates/activities/_post.html +++ b/templates/activities/_post.html @@ -37,6 +37,9 @@ View Post & Replies + + Report + {% if post.author == request.identity %} Edit diff --git a/templates/admin/report_view.html b/templates/admin/report_view.html new file mode 100644 index 0000000..c9819b4 --- /dev/null +++ b/templates/admin/report_view.html @@ -0,0 +1,84 @@ +{% extends "settings/base.html" %} + +{% block subtitle %}Report {{ report.pk }}{% endblock %} + +{% block content %} +
+ {% csrf_token %} +
+ Report + + {% if report.subject_post %} + {% include "activities/_mini_post.html" with post=report.subject_post %} + {% else %} + {% include "activities/_identity.html" with identity=report.subject_identity %} + {% endif %} + + {% if report.source_identity %} + {% include "activities/_identity.html" with identity=report.source_identity %} + {% else %} +

Remote server {{ report.source_domain.domain }}

+ {% endif %} + +

{{ report.complaint|linebreaks }}

+ {% if report.resolved %} + +

+ {{ report.resolved|timesince }} ago by + {{ report.moderator.name_or_handle }} +

+ {% endif %} +
+
+ Moderator Notes + {% include "forms/_field.html" with field=form.notes %} +
+
+ Resolution Options + + + {% if report.resolved and report.valid %} + + + {% else %} + + + {% endif %} + + + {% if report.resolved and not report.valid %} + + + {% else %} + + + {% endif %} + + + {% if report.subject_identity.limited %} + + + {% else %} + + + {% endif %} + + + {% if report.subject_identity.blocked %} + + + {% else %} + + + {% endif %} + +
Report is already resolved as validMark report against the identity but take no further action
Report is already resolved as invalidMark report as invalid and take no action
User is already limitedMake them less visible on this server
User is already blockedRemove their existence entirely from this server
+
+
+ Back + View Profile + Identity Admin + +
+
+{% endblock %} diff --git a/templates/admin/reports.html b/templates/admin/reports.html new file mode 100644 index 0000000..1634443 --- /dev/null +++ b/templates/admin/reports.html @@ -0,0 +1,43 @@ +{% extends "settings/base.html" %} +{% load activity_tags %} + +{% block subtitle %}Reports{% endblock %} + +{% block content %} +
+ {% if all %} + Show Resolved + {% else %} + Show Resolved + {% endif %} +
+
+ {% for report in page_obj %} + + Avatar for {{ report.subject_identity.name_or_handle }} + + {{ report.subject_identity.html_name_or_handle }} + {% if report.subject_post %} + (post {{ report.subject_post.pk }}) + {% endif %} + + {{ report.type|title }} + + + + + {% empty %} +

+ There are no {% if all %}reports yet{% else %}unresolved reports{% endif %}. +

+ {% endfor %} +
+ {% if page_obj.has_previous %} + Previous Page + {% endif %} + {% if page_obj.has_next %} + Next Page + {% endif %} +
+
+{% endblock %} diff --git a/templates/settings/_menu.html b/templates/settings/_menu.html index 0a6062d..45b7ee3 100644 --- a/templates/settings/_menu.html +++ b/templates/settings/_menu.html @@ -39,8 +39,8 @@ Hashtags - - Tuning + + Reports Stator diff --git a/templates/users/report.html b/templates/users/report.html new file mode 100644 index 0000000..557b35e --- /dev/null +++ b/templates/users/report.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block title %}Report{% endblock %} + +{% block content %} +
+ {% csrf_token %} +
+ Report + + {% if post %} + {% include "activities/_mini_post.html" %} + {% else %} + {% include "activities/_identity.html" %} + {% endif %} + {% include "forms/_field.html" with field=form.type %} + {% include "forms/_field.html" with field=form.complaint %} + {% if not identity.local %} + {% include "forms/_field.html" with field=form.forward %} + {% endif %} +
+ +
+ +
+
+{% endblock %} diff --git a/templates/users/report_sent.html b/templates/users/report_sent.html new file mode 100644 index 0000000..4e8c78c --- /dev/null +++ b/templates/users/report_sent.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block title %}Report Sent{% endblock %} + +{% block content %} +
+ {% csrf_token %} +
+ Report +

Your report has been sent.

+
+
+{% endblock %} -- cgit v1.2.3