This should be my final code update before I am ready for review! Basically, in
[mediagoblin.git] / mediagoblin / templates / mediagoblin / moderation / report_panel.html
CommitLineData
3ce0c611 1{#
2# GNU MediaGoblin -- federated, autonomous media hosting
3# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
4#
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.
9#
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.
14#
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/>.
17#}
18{% extends "mediagoblin/base.html" %}
6acf4ee6 19{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
3ce0c611 20
21{% block title -%}
22 {% trans %}Report panel{% endtrans %} &mdash; {{ super() }}
23{%- endblock %}
24
25{% block mediagoblin_content %}
26
27<h1>{% trans %}Report panel{% endtrans %}</h1>
28
29<p>
3aa3871b 30 {% trans %}
31 Here you can look up open reports that have been filed by users.
32 {% endtrans %}
3ce0c611 33</p>
dfd66b78 34
3aa3871b 35<h2>{% trans %}Active Reports Filed{% endtrans %}</h2>
dc31cd1b 36 {% if not active_settings.last_page == 1 %}
6acf4ee6 37 {% if 'active_p='~active_settings.current_page in request.query_string %}
dc31cd1b 38 {% set query_string = request.query_string %}{% else %}
39 {% set query_string =
6acf4ee6 40'active_p='~active_settings.current_page~"&"+request.query_string %}
dc31cd1b 41 {% endif %}
42 <div class="right_align">
6acf4ee6 43 {% set first_vis = active_settings.current_page-3 %}
44 {% set last_vis = active_settings.current_page+3 %}
45 {% set curr_page = active_settings.current_page %}
dc31cd1b 46 {% if 1 == curr_page %}<b>1</b>{% else %}
47 <a href ="?{{ query_string.replace(
6acf4ee6 48 'active_p='~active_settings.current_page,
dc31cd1b 49 'active_p='~1) }}">
6acf4ee6 50 1</a>{% endif %}
dc31cd1b 51 {% if first_vis > 1 %}...{% endif %}
52 {% for p in range(first_vis,last_vis+1) %}
6acf4ee6 53 {% if p > 1 and p < active_settings.last_page and
54curr_page !=p %}
dc31cd1b 55 <a href="?{{ query_string.replace(
6acf4ee6 56 'active_p='~active_settings.current_page,
dc31cd1b 57 'active_p='~p) }}">
58 {{ p }}</a>
6acf4ee6 59 {% elif p > 1 and p < active_settings.last_page %}
60 <b>{{ p }}</b>
dc31cd1b 61 {% endif %}
62 {% endfor %}
63 {% if last_vis < active_settings.last_page %}...{% endif %}
6acf4ee6 64 {% if active_settings.last_page != curr_page %}
dc31cd1b 65 <a href ="?{{ query_string.replace(
6acf4ee6 66 'active_p='~active_settings.current_page,
dc31cd1b 67 'active_p='~active_settings.last_page) }}">
68 {{ active_settings.last_page }}</a>
6acf4ee6 69 {% else %}<b>{{ active_settings.last_page }}</b>
70 {% endif %}
dc31cd1b 71 </div>
72 {% endif %}
3ce0c611 73{% if report_list.count() %}
74 <table class="admin_panel processing">
75 <tr>
3aa3871b 76 <th></th>
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>
3ce0c611 81 </tr>
82 {% for report in report_list %}
83 <tr>
84 {% if report.discriminator == "comment_report" %}
3aa3871b 85 <td>
dfd66b78 86 <img
87 src="{{ request.staticdirect('/images/icon_clipboard_alert.png') }}"
3aa3871b 88 alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
89 Distributed by the GNOME project http://www.gnome.org" />
90 <a href="{{ request.urlgen(
91 'mediagoblin.moderation.reports_detail',
92 report_id=report.id) }}">
93 {% trans report_id=report.id %}
dfd66b78 94 Comment Report #{{ report_id }}
3aa3871b 95 {% endtrans %}
96 </a>
97 </td>
3ce0c611 98 {% elif report.discriminator == "media_report" %}
3aa3871b 99 <td>
dfd66b78 100 <img
101 src="{{ request.staticdirect('/images/icon_clipboard_alert.png') }}"
3aa3871b 102 alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
103 Distributed by the GNOME project http://www.gnome.org" />
104 <a href="{{ request.urlgen(
105 'mediagoblin.moderation.reports_detail',
106 report_id=report.id) }}">
107 {% trans report_id=report.id %}
108 Media Report #{{ report_id }}
109 {% endtrans %}
110 </a>
111 </td>
3ce0c611 112 {% endif %}
3aa3871b 113 <td>{{ report.reported_user.username }}</td>
114 <td>{{ report.created.strftime("%F %R") }}</td>
115 <td>{{ report.reporter.username }}</td>
116 <td>{{ report.report_content[0:20] }}...</td>
3ce0c611 117 </tr>
118 {% endfor %}
119 </table>
120{% else %}
121 <p><em>{% trans %}No open reports found.{% endtrans %}</em></p>
122{% endif %}
6bba33d7 123<h2>{% trans %}Closed Reports{% endtrans %}</h2>
dc31cd1b 124 {% if not closed_settings.last_page == 1 %}
6acf4ee6 125 {% if 'closed_p='~closed_settings.current_page in request.query_string %}
dc31cd1b 126 {% set query_string = request.query_string %}{% else %}
127 {% set query_string =
6acf4ee6 128'closed_p='~closed_settings.current_page~"&"+request.query_string %}
dc31cd1b 129 {% endif %}
130 <div class="right_align">
6acf4ee6 131 {% set first_vis = closed_settings.current_page-3 %}
132 {% set last_vis = closed_settings.current_page+3 %}
133 {% set curr_page = closed_settings.current_page %}
134 {% if not curr_page==1 %}
dc31cd1b 135 <a href ="?{{ query_string.replace(
6acf4ee6 136 'closed_p='~closed_settings.current_page,
137 'closed_p='~1) }}">1</a>
138 {% else %}
139 <b>1 </b>
140 {% endif %}
dc31cd1b 141 {% if first_vis > 1 %}...{% endif %}
142 {% for p in range(first_vis,last_vis+1) %}
6acf4ee6 143 {% if p > 1 and p < closed_settings.last_page and
144curr_page !=p %}
dc31cd1b 145 <a href="?{{ query_string.replace(
6acf4ee6 146 'closed_p='~closed_settings.current_page,
dc31cd1b 147 'closed_p='~p) }}">
148 {{ p }}</a>
6acf4ee6 149
150 {% elif p > 1 and p < closed_settings.last_page %}
151 <b>{{ p }}</b>
dc31cd1b 152 {% endif %}
153 {% endfor %}
154 {% if last_vis < closed_settings.last_page %}...{% endif %}
6acf4ee6 155 {% if curr_page != closed_settings.last_page %}
156 <a href ="?{{ query_string.replace(
157 'closed_p='~closed_settings.current_page,
dc31cd1b 158 'closed_p='~closed_settings.last_page) }}">
6acf4ee6 159 {{ closed_settings.last_page }}</a>
160 {% else %}<b>{{ closed_settings.last_page }}</b>
161 {% endif %}
dc31cd1b 162 </div>
163 {% endif %}
3ce0c611 164{% if closed_report_list.count() %}
165 <table class="media_panel processing">
166 <tr>
3aa3871b 167 <th></th>
168 <th>{% trans %}Resolved{% endtrans %}</th>
169 <th>{% trans %}Offender{% endtrans %}</th>
170 <th>{% trans %}Action Taken{% endtrans %}</th>
171 <th>{% trans %}Reported By{% endtrans %}</th>
172 <th>{% trans %}Reason{% endtrans %}</th>
3ce0c611 173 </tr>
174 {% for report in closed_report_list %}
3aa3871b 175 <tr>
176 <td>
dfd66b78 177 <img
178 src="{{ request.staticdirect('/images/icon_clipboard.png') }}"
3aa3871b 179 alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
180 Distributed by the GNOME project http://www.gnome.org" />
181 <a href="{{ request.urlgen('mediagoblin.moderation.reports_detail',
182 report_id=report.id) }}">
183 {% trans report_id=report.id %}
184 Closed Report #{{ report_id }}
185 {% endtrans %}
186 </a>
187 </td>
188 <td>{{ report.resolved.strftime("%F %R") }}</td>
189 <td>{{ report.reported_user.username }}</td>
190 <td>{{ report.created.strftime("%F %R") }}</td>
191 <td>{{ report.reporter.username }}</td>
8394febb 192 <td>{{ report.report_content[:15] }}...</td>
3aa3871b 193 </tr>
3ce0c611 194 {% endfor %}
195 </table>
196{% else %}
197 <p><em>{% trans %}No closed reports found.{% endtrans %}</em></p>
dfd66b78 198{% endif %}
6acf4ee6 199
3ce0c611 200{% endblock %}