UI for deciding to send reports to remote

Shows a checkbox for the user and lets the admin know
This commit is contained in:
Mouse Reeve 2024-01-02 19:14:40 -08:00
parent d4013b9721
commit 0612930fb9
3 changed files with 19 additions and 1 deletions

View file

@ -44,7 +44,7 @@ class GoalForm(CustomForm):
class ReportForm(CustomForm):
class Meta:
model = models.Report
fields = ["reported_user", "user", "status", "links", "note"]
fields = ["reported_user", "user", "status", "links", "note", "allow_broadcast"]
class ReadThroughForm(CustomForm):

View file

@ -23,6 +23,15 @@
<div class="card-footer-item">
<p>{% blocktrans with username=report.user|username path=report.user.local_path %}Reported by <a href="{{ path }}">@{{ username }}</a>{% endblocktrans %}</p>
</div>
{% if not report.reported_user.local %}
<div class="card-footer-item">
{% if report.allow_broadcast %}
<p>{% trans "Sent to remote instance" %}</p>
{% else %}
<p>{% trans "<b>Not</b> sent to remote instance" %}</p>
{% endif %}
</div>
{% endif %}
<div class="card-footer-item">
{{ report.created_date | naturaltime }}
</div>

View file

@ -36,6 +36,15 @@
{% trans "Links from this domain will be removed until your report has been reviewed." %}
{% endif %}
</p>
{% if not reported_user.local %}
<label class="checkbox label">
<input class="checkbox" id="id_allow_broadcast" type="checkbox" name="allow_broadcast" checked>
{% trans "Also send this report to the user's instance admins" %}
</label>
{% else %}
<input type="hidden" name="allow_broadcast">
{% endif %}
</p>
<div class="control">
<label class="label" for="id_{{ controls_uid }}_report_note">
{% trans "More info about this report:" %}