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 %} — {{ 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> |
6483b370 |
36 | {% if report_list.count() %} |
dc31cd1b |
37 | {% if not active_settings.last_page == 1 %} |
6acf4ee6 |
38 | {% if 'active_p='~active_settings.current_page in request.query_string %} |
dc31cd1b |
39 | {% set query_string = request.query_string %}{% else %} |
40 | {% set query_string = |
6acf4ee6 |
41 | 'active_p='~active_settings.current_page~"&"+request.query_string %} |
dc31cd1b |
42 | {% endif %} |
43 | <div class="right_align"> |
6acf4ee6 |
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 %} |
dc31cd1b |
47 | {% if 1 == curr_page %}<b>1</b>{% else %} |
48 | <a href ="?{{ query_string.replace( |
6acf4ee6 |
49 | 'active_p='~active_settings.current_page, |
dc31cd1b |
50 | 'active_p='~1) }}"> |
6acf4ee6 |
51 | 1</a>{% endif %} |
dc31cd1b |
52 | {% if first_vis > 1 %}...{% endif %} |
53 | {% for p in range(first_vis,last_vis+1) %} |
6acf4ee6 |
54 | {% if p > 1 and p < active_settings.last_page and |
55 | curr_page !=p %} |
dc31cd1b |
56 | <a href="?{{ query_string.replace( |
6acf4ee6 |
57 | 'active_p='~active_settings.current_page, |
dc31cd1b |
58 | 'active_p='~p) }}"> |
59 | {{ p }}</a> |
6acf4ee6 |
60 | {% elif p > 1 and p < active_settings.last_page %} |
61 | <b>{{ p }}</b> |
dc31cd1b |
62 | {% endif %} |
63 | {% endfor %} |
64 | {% if last_vis < active_settings.last_page %}...{% endif %} |
6acf4ee6 |
65 | {% if active_settings.last_page != curr_page %} |
dc31cd1b |
66 | <a href ="?{{ query_string.replace( |
6acf4ee6 |
67 | 'active_p='~active_settings.current_page, |
dc31cd1b |
68 | 'active_p='~active_settings.last_page) }}"> |
69 | {{ active_settings.last_page }}</a> |
6acf4ee6 |
70 | {% else %}<b>{{ active_settings.last_page }}</b> |
71 | {% endif %} |
dc31cd1b |
72 | </div> |
73 | {% endif %} |
3ce0c611 |
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 |
0b1fcaeb |
87 | src="{{ request.staticdirect( |
88 | '/images/icon_clipboard_alert.png') }}" |
3aa3871b |
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 %} |
dfd66b78 |
95 | Comment Report #{{ report_id }} |
3aa3871b |
96 | {% endtrans %} |
97 | </a> |
98 | </td> |
3ce0c611 |
99 | {% elif report.discriminator == "media_report" %} |
3aa3871b |
100 | <td> |
dfd66b78 |
101 | <img |
0b1fcaeb |
102 | src="{{ request.staticdirect( |
103 | '/images/icon_clipboard_alert.png') }}" |
3aa3871b |
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 }} |
111 | {% endtrans %} |
112 | </a> |
113 | </td> |
3ce0c611 |
114 | {% endif %} |
3aa3871b |
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> |
3ce0c611 |
119 | </tr> |
120 | {% endfor %} |
121 | </table> |
122 | {% else %} |
123 | <p><em>{% trans %}No open reports found.{% endtrans %}</em></p> |
124 | {% endif %} |
6bba33d7 |
125 | <h2>{% trans %}Closed Reports{% endtrans %}</h2> |
6483b370 |
126 | {% if closed_report_list.count() %} |
dc31cd1b |
127 | {% if not closed_settings.last_page == 1 %} |
6acf4ee6 |
128 | {% if 'closed_p='~closed_settings.current_page in request.query_string %} |
dc31cd1b |
129 | {% set query_string = request.query_string %}{% else %} |
130 | {% set query_string = |
6acf4ee6 |
131 | 'closed_p='~closed_settings.current_page~"&"+request.query_string %} |
dc31cd1b |
132 | {% endif %} |
133 | <div class="right_align"> |
6acf4ee6 |
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 %} |
dc31cd1b |
138 | <a href ="?{{ query_string.replace( |
6acf4ee6 |
139 | 'closed_p='~closed_settings.current_page, |
140 | 'closed_p='~1) }}">1</a> |
141 | {% else %} |
142 | <b>1 </b> |
143 | {% endif %} |
dc31cd1b |
144 | {% if first_vis > 1 %}...{% endif %} |
145 | {% for p in range(first_vis,last_vis+1) %} |
6acf4ee6 |
146 | {% if p > 1 and p < closed_settings.last_page and |
147 | curr_page !=p %} |
dc31cd1b |
148 | <a href="?{{ query_string.replace( |
6acf4ee6 |
149 | 'closed_p='~closed_settings.current_page, |
dc31cd1b |
150 | 'closed_p='~p) }}"> |
151 | {{ p }}</a> |
6acf4ee6 |
152 | |
153 | {% elif p > 1 and p < closed_settings.last_page %} |
154 | <b>{{ p }}</b> |
dc31cd1b |
155 | {% endif %} |
156 | {% endfor %} |
157 | {% if last_vis < closed_settings.last_page %}...{% endif %} |
6acf4ee6 |
158 | {% if curr_page != closed_settings.last_page %} |
159 | <a href ="?{{ query_string.replace( |
160 | 'closed_p='~closed_settings.current_page, |
dc31cd1b |
161 | 'closed_p='~closed_settings.last_page) }}"> |
6acf4ee6 |
162 | {{ closed_settings.last_page }}</a> |
163 | {% else %}<b>{{ closed_settings.last_page }}</b> |
164 | {% endif %} |
dc31cd1b |
165 | </div> |
166 | {% endif %} |
3ce0c611 |
167 | <table class="media_panel processing"> |
168 | <tr> |
3aa3871b |
169 | <th></th> |
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> |
3ce0c611 |
175 | </tr> |
176 | {% for report in closed_report_list %} |
3aa3871b |
177 | <tr> |
178 | <td> |
dfd66b78 |
179 | <img |
180 | src="{{ request.staticdirect('/images/icon_clipboard.png') }}" |
3aa3871b |
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 }} |
187 | {% endtrans %} |
188 | </a> |
189 | </td> |
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> |
8394febb |
194 | <td>{{ report.report_content[:15] }}...</td> |
3aa3871b |
195 | </tr> |
3ce0c611 |
196 | {% endfor %} |
197 | </table> |
198 | {% else %} |
199 | <p><em>{% trans %}No closed reports found.{% endtrans %}</em></p> |
dfd66b78 |
200 | {% endif %} |
6acf4ee6 |
201 | |
3ce0c611 |
202 | {% endblock %} |