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 + Report about + {% 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 %} + Reported by + {% if report.source_identity %} + {% include "activities/_identity.html" with identity=report.source_identity %} + {% else %} + Remote server {{ report.source_domain.domain }} + {% endif %} + Complaint + {{ report.complaint|linebreaks }} + {% if report.resolved %} + 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 %} + Resolve Valid + Report is already resolved as valid + {% else %} + Resolve Valid + Mark report against the identity but take no further action + {% endif %} + + + {% if report.resolved and not report.valid %} + Resolve Invalid + Report is already resolved as invalid + {% else %} + Resolve Invalid + Mark report as invalid and take no action + {% endif %} + + + {% if report.subject_identity.limited %} + Limit + User is already limited + {% else %} + Limit + Make them less visible on this server + {% endif %} + + + {% if report.subject_identity.blocked %} + Block + User is already blocked + {% else %} + Block + Remove their existence entirely from this server + {% endif %} + + + + + Back + View Profile + Identity Admin + Save Notes + + +{% 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 %} + + + + {{ report.subject_identity.html_name_or_handle }} + {% if report.subject_post %} + (post {{ report.subject_post.pk }}) + {% endif %} + + {{ report.type|title }} + + + {{ report.created|timedeltashort }} ago + + {% 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 + Reporting + {% 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 %} + + + + Send Report + + +{% 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
Remote server {{ report.source_domain.domain }}
{{ report.complaint|linebreaks }}
+ {{ report.resolved|timesince }} ago by + {{ report.moderator.name_or_handle }} +
+ There are no {% if all %}reports yet{% else %}unresolved reports{% endif %}. +
Your report has been sent.