Commit f15971ce authored by Sli's avatar Sli

pedagogy: simplify moderation form for user

parent 99cf59c7
Pipeline #1901 passed with stage
in 44 minutes and 3 seconds
This diff is collapsed.
{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import select_all_checkbox %}
{% block title %}
{% trans %}UV comment moderation{% endtrans %}
{% endblock title %}
{% block content %}
<form action="{{ url('pedagogy:moderation') }}", id="moderation_delete_form" method="post" enctype="multipart/form-data">
{% csrf_token %}
<p style="margin-bottom: 1em;">{{ select_all_checkbox("moderation_delete_form") }}</p>
<table>
<thead>
<tr>
<td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}Comment{% endtrans %}</td>
<td>{% trans %}Reason{% endtrans %}</td>
<td>{% trans %}Delete{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% set queryset = form.accepted_reports.field.queryset %}
{% for widget in form.accepted_reports.subwidgets %}
{% set report = queryset.get(id=widget.data.value) %}
<tr>
<td><a href="{{ url('pedagogy:uv_detail', uv_id=report.comment.uv.id) }}#{{ report.comment.uv.id }}">{{ report.comment.uv }}</a></td>
<td>{{ report.comment.comment|markdown }}</td>
<td>{{ report.reason|markdown }}</td>
<td>{{ widget.tag() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p><input type="submit" value="{% trans %}Delete comments{% endtrans %}"></p>
</form>
<form action="{{ url('pedagogy:moderation') }}", id="moderation_keep_form" method="post" enctype="multipart/form-data">
{% csrf_token %}
<p style="margin-bottom: 1em;">{{ select_all_checkbox("moderation_keep_form") }}</p>
<table>
<thead>
<tr>
<td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}Comment{% endtrans %}</td>
<td>{% trans %}Reason{% endtrans %}</td>
<td>{% trans %}Delete{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% set queryset = form.denied_reports.field.queryset %}
{% for widget in form.denied_reports.subwidgets %}
{% set report = queryset.get(id=widget.data.value) %}
{{ form.errors }}
<table>
<thead>
<tr>
<td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}Comment{% endtrans %}</td>
<td>{% trans %}Reason{% endtrans %}</td>
<td>{% trans %}Action{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% set queryset = form.accepted_reports.field.queryset %}
{% for widget in form.accepted_reports.subwidgets %}
{% set report = queryset.get(id=widget.data.value) %}
<form action="{{ url('pedagogy:moderation') }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<tr>
<td><a href="{{ url('pedagogy:uv_detail', uv_id=report.comment.uv.id) }}#{{ report.comment.uv.id }}">{{ report.comment.uv }}</a></td>
<td>{{ report.comment.comment|markdown }}</td>
<td>{{ report.reason|markdown }}</td>
<td>{{ widget.tag() }}</td>
<td>
<button name="accepted_reports" type="submit" value="{{ report.id }}">{% trans %}Delete comment{% endtrans %}</button>
<button name="denied_reports" type="submit" value="{{ report.id }}">{% trans %}Delete report{% endtrans %}</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<p><input type="submit" value="{% trans %}Delete report{% endtrans %}"></p>
</form>
</form>
{% endfor %}
</tbody>
</table>
{% endblock content %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment