2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C)
2011,
2012 MediaGoblin contributors. See AUTHORS.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version
3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program. If not, see
<http://www.gnu.org/licenses
/>.
18 {% extends
"mediagoblin/base.html" %}
19 {% import
"/mediagoblin/utils/wtforms.html" as wtforms_util %}
22 {% trans %}Report panel{% endtrans %}
— {{ super() }}
25 {% block mediagoblin_content %}
27 <h1>{% trans %}Report panel{% endtrans %}
</h1>
31 Here you can look up open reports that have been filed by users.
35 <h2>{% trans %}Active Reports Filed{% endtrans %}
</h2>
36 {% if report_list.count() %}
37 {% if not active_settings.last_page ==
1 %}
38 {% if 'active_p='~active_settings.current_page in request.query_string %}
39 {% set query_string = request.query_string %}{% else %}
41 'active_p='~active_settings.current_page~
"&"+request.query_string %}
43 <div class=
"right_align">
44 {% set first_vis = active_settings.current_page-
3 %}
45 {% set last_vis = active_settings.current_page+
3 %}
46 {% set curr_page = active_settings.current_page %}
47 {% if
1 == curr_page %}
<b>1</b>{% else %}
48 <a href =
"?{{ query_string.replace(
49 'active_p='~active_settings.current_page,
52 {% if first_vis
> 1 %}...{% endif %}
53 {% for p in range(first_vis,last_vis+
1) %}
54 {% if p
> 1 and p < active_settings.last_page and
56 <a href=
"?{{ query_string.replace(
57 'active_p='~active_settings.current_page,
60 {% elif p
> 1 and p < active_settings.last_page %}
64 {% if last_vis < active_settings.last_page %}...{% endif %}
65 {% if active_settings.last_page != curr_page %}
66 <a href =
"?{{ query_string.replace(
67 'active_p='~active_settings.current_page,
68 'active_p='~active_settings.last_page) }}">
69 {{ active_settings.last_page }}
</a>
70 {% else %}
<b>{{ active_settings.last_page }}
</b>
74 <table class=
"admin_panel processing">
77 <th>{% trans %}Offender{% endtrans %}
</th>
78 <th>{% trans %}When Reported{% endtrans %}
</th>
79 <th>{% trans %}Reported By{% endtrans %}
</th>
80 <th>{% trans %}Reason{% endtrans %}
</th>
82 {% for report in report_list %}
84 {% if report.discriminator ==
"comment_report" %}
87 src=
"{{ request.staticdirect(
88 '/images/icon_clipboard_alert.png') }}"
89 alt=
"Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
90 Distributed by the GNOME project http://www.gnome.org" />
91 <a href=
"{{ request.urlgen(
92 'mediagoblin.moderation.reports_detail',
93 report_id=report.id) }}">
94 {% trans report_id=report.id %}
95 Comment Report #{{ report_id }}
99 {% elif report.discriminator ==
"media_report" %}
102 src=
"{{ request.staticdirect(
103 '/images/icon_clipboard_alert.png') }}"
104 alt=
"Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
105 Distributed by the GNOME project http://www.gnome.org" />
106 <a href=
"{{ request.urlgen(
107 'mediagoblin.moderation.reports_detail',
108 report_id=report.id) }}">
109 {% trans report_id=report.id %}
110 Media Report #{{ report_id }}
115 <td>{{ report.reported_user.username }}
</td>
116 <td>{{ report.created.strftime(
"%F %R") }}
</td>
117 <td>{{ report.reporter.username }}
</td>
118 <td>{{ report.report_content[
0:
20] }}...
</td>
123 <p><em>{% trans %}No open reports found.{% endtrans %}
</em></p>
125 <h2>{% trans %}Closed Reports{% endtrans %}
</h2>
126 {% if closed_report_list.count() %}
127 {% if not closed_settings.last_page ==
1 %}
128 {% if 'closed_p='~closed_settings.current_page in request.query_string %}
129 {% set query_string = request.query_string %}{% else %}
130 {% set query_string =
131 'closed_p='~closed_settings.current_page~
"&"+request.query_string %}
133 <div class=
"right_align">
134 {% set first_vis = closed_settings.current_page-
3 %}
135 {% set last_vis = closed_settings.current_page+
3 %}
136 {% set curr_page = closed_settings.current_page %}
137 {% if not curr_page==
1 %}
138 <a href =
"?{{ query_string.replace(
139 'closed_p='~closed_settings.current_page,
140 'closed_p='~1) }}">1</a>
144 {% if first_vis
> 1 %}...{% endif %}
145 {% for p in range(first_vis,last_vis+
1) %}
146 {% if p
> 1 and p < closed_settings.last_page and
148 <a href=
"?{{ query_string.replace(
149 'closed_p='~closed_settings.current_page,
153 {% elif p
> 1 and p < closed_settings.last_page %}
157 {% if last_vis < closed_settings.last_page %}...{% endif %}
158 {% if curr_page != closed_settings.last_page %}
159 <a href =
"?{{ query_string.replace(
160 'closed_p='~closed_settings.current_page,
161 'closed_p='~closed_settings.last_page) }}">
162 {{ closed_settings.last_page }}
</a>
163 {% else %}
<b>{{ closed_settings.last_page }}
</b>
167 <table class=
"media_panel processing">
170 <th>{% trans %}Resolved{% endtrans %}
</th>
171 <th>{% trans %}Offender{% endtrans %}
</th>
172 <th>{% trans %}Action Taken{% endtrans %}
</th>
173 <th>{% trans %}Reported By{% endtrans %}
</th>
174 <th>{% trans %}Reason{% endtrans %}
</th>
176 {% for report in closed_report_list %}
180 src=
"{{ request.staticdirect('/images/icon_clipboard.png') }}"
181 alt=
"Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
182 Distributed by the GNOME project http://www.gnome.org" />
183 <a href=
"{{ request.urlgen('mediagoblin.moderation.reports_detail',
184 report_id=report.id) }}">
185 {% trans report_id=report.id %}
186 Closed Report #{{ report_id }}
190 <td>{{ report.resolved.strftime(
"%F %R") }}
</td>
191 <td>{{ report.reported_user.username }}
</td>
192 <td>{{ report.created.strftime(
"%F %R") }}
</td>
193 <td>{{ report.reporter.username }}
</td>
194 <td>{{ report.report_content[:
15] }}...
</td>
199 <p><em>{% trans %}No closed reports found.{% endtrans %}
</em></p>