Allow moderators to delete reported statuses

This commit is contained in:
Mouse Reeve
2021-03-12 11:25:56 -08:00
parent 677a49fee3
commit 8c74beb78c
6 changed files with 47 additions and 5 deletions

View File

@ -15,6 +15,7 @@
<div class="block content">
<h3>{% trans "Actions" %}</h3>
<p><a href="{{ report.user.local_path }}">{% trans "View user profile" %}</a></p>
<div class="is-flex">
<p class="mr-1">
<a class="button" href="{% url 'direct-messages-user' report.user.username %}">{% trans "Send direct message" %}</a>
@ -46,7 +47,11 @@
<ul>
{% for status in report.statuses.select_subclasses.all %}
<li>
{% if status.deleted %}
<em>{% trans "Statuses has been deleted" %}</em>
{% else %}
{% include 'snippets/status/status.html' with status=status moderation_mode=True %}
{% endif %}
</li>
{% endfor %}
</ul>

View File

@ -12,7 +12,6 @@
<p>
{% if report.note %}{{ report.note }}{% else %}<em>{% trans "No notes provided" %}</em>{% endif %}
</p>
<p><a href="{{ report.user.local_path }}">{% trans "View user profile" %}</a></p>
</div>
{% endblock %}

View File

@ -19,8 +19,15 @@
{% block card-footer %}
<div class="card-footer-item">
{% if moderation_mode and perms.bookwyrm.moderate_post %}
{# moderation options #}
<button class="button is-danger is-light">{% trans "Delete status" %}</button>
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="/delete-status/{{ status.id }}" method="post">
{% csrf_token %}
<button class="button is-danger is-light" type="submit">
{% trans "Delete status" %}
</button>
</form>
{% elif request.user.is_authenticated %}
<div class="field has-addons">
<div class="control">