diff --git a/bookwyrm/emailing.py b/bookwyrm/emailing.py index efef1263..80aca071 100644 --- a/bookwyrm/emailing.py +++ b/bookwyrm/emailing.py @@ -48,7 +48,9 @@ def moderation_report_email(report): data["reportee"] = report.user.localname or report.user.username data["report_link"] = report.remote_id - for admin in models.User.objects.filter(groups__name__in=["admin", "moderator"]): + for admin in models.User.objects.filter( + groups__name__in=["admin", "moderator"] + ).distinct(): data["user"] = admin.display_name send_email.delay(admin.email, *format_email("moderation_report", data)) diff --git a/bookwyrm/models/report.py b/bookwyrm/models/report.py index a9f5b3b1..bd2a1ef0 100644 --- a/bookwyrm/models/report.py +++ b/bookwyrm/models/report.py @@ -1,5 +1,6 @@ """ flagged for moderation """ from django.db import models +from bookwyrm.settings import DOMAIN from .base_model import BookWyrmModel @@ -15,6 +16,9 @@ class Report(BookWyrmModel): links = models.ManyToManyField("Link", blank=True) resolved = models.BooleanField(default=False) + def get_remote_id(self): + return f"https://{DOMAIN}/settings/reports/{self.id}" + class Meta: """set order by default""" diff --git a/bookwyrm/templates/settings/reports/report.html b/bookwyrm/templates/settings/reports/report.html index 84fafb14..a795273b 100644 --- a/bookwyrm/templates/settings/reports/report.html +++ b/bookwyrm/templates/settings/reports/report.html @@ -17,6 +17,19 @@ {% include 'settings/reports/report_preview.html' with report=report %} +
+
+ + {% trans "Message reporter" %} + + +
+ {% trans "Update on your report:" as dm_template %} + {% include 'snippets/create_status/status.html' with type="direct" uuid=1 mention=report.reporter prepared_content=dm_template no_script=True %} +
+
+
+ {% if report.statuses.exists %}

{% trans "Reported statuses" %}

@@ -68,9 +81,13 @@ {% endfor %}
{% csrf_token %} - - - +
+ + +
+
+ +
{% endblock %} diff --git a/bookwyrm/templates/snippets/create_status/content_field.html b/bookwyrm/templates/snippets/create_status/content_field.html index ea2849d9..cc4205b2 100644 --- a/bookwyrm/templates/snippets/create_status/content_field.html +++ b/bookwyrm/templates/snippets/create_status/content_field.html @@ -8,13 +8,14 @@ reply_parent: if applicable, the Status object that this post is in reply to mention: a user who is @ mentioned by default in the post draft: an existing Status object that is providing default values for input fields {% endcomment %} - - +
+ +
diff --git a/bookwyrm/templates/snippets/create_status/post_options_block.html b/bookwyrm/templates/snippets/create_status/post_options_block.html index 697614e1..17131532 100644 --- a/bookwyrm/templates/snippets/create_status/post_options_block.html +++ b/bookwyrm/templates/snippets/create_status/post_options_block.html @@ -15,7 +15,7 @@ {% endif %} -
+