Add moderation tool to Trombi

This commit is contained in:
Skia
2017-05-12 18:30:06 +02:00
parent adeda41b52
commit 231cb236dc
9 changed files with 234 additions and 46 deletions

View File

@ -0,0 +1,34 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Moderate Trombi comments{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans %}Moderate Trombi comments{% endtrans %}</h3>
<h4>{{ trombi }}</h4>
<a href="{{ url('trombi:detail', trombi_id=object.id) }}">{% trans %}Back{% endtrans %}</a>
<hr>
<dl>
{% for c in comments %}
<dt>{% trans author=c.author.user.get_display_name(),
target=c.target.user.get_display_name() %}Author: {{ author }} - Target: {{ target }}{% endtrans %}</dt>
<dd>
<p>
{{ c.content }}
</p>
<form action="{{ url('trombi:moderate_comment', comment_id=c.id )}}" method="post">
{% csrf_token %}
<input type="hidden" name="action" id="action" value="accept" />
<p><input type="submit" value="{% trans %}Accept{% endtrans %}" /></p>
</form>
<form action="{{ url('trombi:moderate_comment', comment_id=c.id )}}" method="post">
{% csrf_token %}
<input type="hidden" name="action" id="action" value="reject" />
<p><input type="submit" value="{% trans %}Reject{% endtrans %}" /></p>
</form>
</dd>
{% endfor %}
</dl>
{% endblock %}

View File

@ -7,6 +7,7 @@
{% block content %}
<h2>{% trans club=object.club %}{{ club }}'s Trombi{% endtrans %}</h2>
<a href="{{ url('trombi:edit', trombi_id=object.id) }}">{% trans %}Edit{% endtrans %}</a>
<a href="{{ url('trombi:moderate_comments', trombi_id=object.id) }}">{% trans %}Moderate comments{% endtrans %}</a>
<p>{% trans %}Subscription deadline: {% endtrans %}{{ object.subscription_deadline|date(DATETIME_FORMAT) }}</p>
<p>{% trans %}Comment deadline: {% endtrans %}{{ object.comments_deadline|date(DATETIME_FORMAT) }}</p>
<a href="#">Export</a>

View File

@ -25,9 +25,9 @@
<img src="{{ scrub_file }}" alt="" style="max-width: 200px">
</div>
<dl>
{% for c in trombi_user.received_comments.all() %}
{% for c in trombi_user.received_comments.filter(is_moderated=True) %}
<dt style="font-weight: bold; font-size: 110%">{{ c.author.user.get_display_name() }}</dt>
<dd>{{ c.content}}</dd>
<dd>{{ c.content }}</dd>
{% endfor %}
</dl>
</div>