This was a quick update to clean up some of my templates and fix the formatting
[mediagoblin.git] / mediagoblin / templates / mediagoblin / moderation / report_panel.html
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" %}
19 {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
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>
30 {% trans %}
31 Here you can look up open reports that have been filed by users.
32 {% endtrans %}
33 </p>
34
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 %}
40 {% set query_string =
41 'active_p='~active_settings.current_page~"&"+request.query_string %}
42 {% endif %}
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,
50 'active_p='~1) }}">
51 1</a>{% endif %}
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
55 curr_page !=p %}
56 <a href="?{{ query_string.replace(
57 'active_p='~active_settings.current_page,
58 'active_p='~p) }}">
59 {{ p }}</a>
60 {% elif p > 1 and p < active_settings.last_page %}
61 <b>{{ p }}</b>
62 {% endif %}
63 {% endfor %}
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>
71 {% endif %}
72 </div>
73 {% endif %}
74 <table class="admin_panel processing">
75 <tr>
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>
81 </tr>
82 {% for report in report_list %}
83 <tr>
84 {% if report.discriminator == "comment_report" %}
85 <td>
86 <img
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 }}
96 {% endtrans %}
97 </a>
98 </td>
99 {% elif report.discriminator == "media_report" %}
100 <td>
101 <img
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 }}
111 {% endtrans %}
112 </a>
113 </td>
114 {% endif %}
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>
119 </tr>
120 {% endfor %}
121 </table>
122 {% else %}
123 <p><em>{% trans %}No open reports found.{% endtrans %}</em></p>
124 {% endif %}
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 %}
132 {% endif %}
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>
141 {% else %}
142 <b>1 </b>
143 {% endif %}
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
147 curr_page !=p %}
148 <a href="?{{ query_string.replace(
149 'closed_p='~closed_settings.current_page,
150 'closed_p='~p) }}">
151 {{ p }}</a>
152
153 {% elif p > 1 and p < closed_settings.last_page %}
154 <b>{{ p }}</b>
155 {% endif %}
156 {% endfor %}
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>
164 {% endif %}
165 </div>
166 {% endif %}
167 <table class="media_panel processing">
168 <tr>
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>
175 </tr>
176 {% for report in closed_report_list %}
177 <tr>
178 <td>
179 <img
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 }}
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>
194 <td>{{ report.report_content[:15] }}...</td>
195 </tr>
196 {% endfor %}
197 </table>
198 {% else %}
199 <p><em>{% trans %}No closed reports found.{% endtrans %}</em></p>
200 {% endif %}
201
202 {% endblock %}