mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
pedagogy: simplify moderation form for user
This commit is contained in:
@ -1,63 +1,37 @@
|
||||
{% 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) %}
|
||||
{{ 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 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) %}
|
||||
<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 report{% endtrans %}"></p>
|
||||
</form>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock content %}
|
||||
|
Reference in New Issue
Block a user