Add file moderation tool

This commit is contained in:
Skia
2016-11-09 09:13:57 +01:00
parent 02be5e1629
commit 9e32840549
9 changed files with 92 additions and 5 deletions

View File

@ -42,7 +42,8 @@
{% if not file.home_of and not file.home_of_club and file.parent %}
<p><a href="{{ url('core:file_delete', file_id=file.id, popup=popup) }}">{% trans %}Delete{% endtrans %}</a></p>
{% endif %}
{% if popup %}
{% if user.is_in_group(settings.SITH_GROUPS['communication-admin']['id']) %}
<p><a href="{{ url('core:file_moderate', file_id=file.id) }}">{% trans %}Moderate{% endtrans %}</a></p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,28 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}File moderation{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans %}File moderation{% endtrans %}</h3>
<div>
{% for f in files %}
<div style="margin: 2px; padding: 2px; border: solid 1px red; text-align: center">
{% if f.is_folder %}
<strong>Folder</strong>
{% else %}
<strong>File</strong>
{% endif %}
<p>
<a href="{{ url("core:file_detail", file_id=f.id) }}">{{ f.name }}</a><br/>
{% trans %}Full name: {% endtrans %}{{ f.get_parent_path()+'/'+f.name }}<br/>
{% trans %}Owner: {% endtrans %}{{ f.owner.get_display_name() }}<br/>
{% trans %}Date: {% endtrans %}{{ f.date|date(DATE_FORMAT) }} {{ f.date|time(TIME_FORMAT) }}<br/>
</p>
<p><a href="{{ url('core:file_moderate', file_id=f.id) }}">{% trans %}Moderate{% endtrans %}</a> -
<a href="{{ url('core:file_delete', file_id=f.id) }}?next={{ url('core:file_moderation') }}">{% trans %}Delete{% endtrans %}</a></p>
</div>
{% endfor %}
</div>
{% endblock %}

View File

@ -8,6 +8,7 @@
<h2>{% trans %}Edit user profile{% endtrans %}</h2>
<form action="" method="post" enctype="multipart/form-data" id="user_edit">
{% csrf_token %}
{{ form.non_field_errors() }}
{% for field in form %}
<p>{{ field.errors }}<label for="{{ field.name }}">{{ field.label }}
{%- if field.name == "profile_pict" -%}

View File

@ -58,6 +58,15 @@
{%- endfor %}
</ul>
{% if user.is_in_group(settings.SITH_GROUPS['communication-admin']['id']) %}
<hr>
<h4>{% trans %}Communication{% endtrans %}</h4>
<ul>
<li><a href="{{ url('core:file_moderation') }}">{% trans %}Moderate files{% endtrans %}</a></li>
</ul>
{% endif %}
<hr>
<h4>{% trans %}Club tools{% endtrans %}</h4>
<ul>