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 %}
23 {%- trans username=user.username -%}
25 {%- endtrans %}
— {{ super() }}
31 {%- block mediagoblin_head %}
32 <script src=
"{{ request.staticdirect('/js/setup_report_forms.js') }}">
36 {% block mediagoblin_content -%}
38 <a href=
"{{ request.urlgen('mediagoblin.moderation.users') }}"
39 class=
"return_to_panel button_action"
40 title=
"Return to Users Panel">
41 {% trans %}Return to Users Panel{% endtrans %}
</a>
44 <div class=
"eight columns">
47 <p>{% trans %}Sorry, no such user found.{% endtrans %}
</p>
48 {# User exists, but needs verification #}
49 {% elif not user.has_privilege('active') %}
50 <div class=
"profile_sidebar empty_space">
51 <h1>{% trans %}Email verification needed{% endtrans %}
</h1>
54 Someone has registered an account with this username, but it still has
61 {# Active(?) (or at least verified at some point) user, horray! #}
64 {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
65 {% if user_banned and user_banned.expiration_date %}
66 — {% trans expiration_date=user_banned.expiration_date -%}
67 BANNED until {{ expiration_date }}
69 {% elif user_banned %}
70 — {% trans %}Banned Indefinitely{% endtrans %}
73 {% if not user.url and not user.bio %}
74 <div class=
"profile_sidebar empty_space">
77 This user hasn't filled in their profile (yet).
81 <div class=
"profile_sidebar">
82 {% include
"mediagoblin/utils/profile.html" %}
83 {% if request.user and
84 (request.user.id == user.id or request.user.has_privilege('admin')) %}
85 <a href=
"{{ request.urlgen('mediagoblin.edit.profile',
86 user=user.username) }}">
87 {%- trans %}Edit profile{% endtrans -%}
92 <a href=
"{{ request.urlgen('mediagoblin.user_pages.collection_list',
93 user=user.username) }}">
94 {%- trans %}Browse collections{% endtrans -%}
101 <div class=
"eight columns">
103 {%- trans username=user.username -%}
104 Active Reports on {{ username }}
107 {% if reports.count() %}
108 <table class=
"admin_side_panel">
110 <th>{%- trans %}Report ID{% endtrans -%}
</th>
111 <th>{%- trans %}Reported Content{% endtrans -%}
</th>
112 <th>{%- trans %}Description of Report{% endtrans -%}
</th>
114 {% for report in reports %}
117 <img src=
"{{ request.staticdirect('/images/icon_clipboard.png') }}" />
118 <a href=
"{{ request.urlgen('mediagoblin.moderation.reports_detail',
119 report_id=report.id) }}">
120 {%- trans report_number=report.id -%}
121 Report #{{ report_number }}
126 {% if report.discriminator ==
"comment_report" %}
127 <a>{%- trans %}Reported Comment{% endtrans -%}
</a>
128 {% elif report.discriminator ==
"media_report" %}
129 <a>{%- trans %}Reported Media Entry{% endtrans -%}
</a>
132 <td>{{ report.report_content[:
21] }}
133 {% if report.report_content|count
>20 %}...{% endif %}
</td>
134 <td>{%- trans %}Resolve{% endtrans -%}
</td>
137 <tr><td></td><td></td>
140 {%- trans username=user.username -%}
141 No active reports filed on {{ username }}
146 <a href=
"{{ request.urlgen(
147 'mediagoblin.moderation.reports') }}?reported_user={{user.id}}">
149 username=user.username %}All reports on {{ username }}{% endtrans %}
</a>
151 <a href=
"{{ request.urlgen(
152 'mediagoblin.moderation.reports') }}?reporter={{user.id}}">
153 {%- trans username=user.username -%}
154 All reports that {{ username }} has filed
157 <span class=clear
></span>
161 <div class=
"row hell">
162 <h2>{% trans username=user.username -%}
163 {{ username }}'s Privileges{% endtrans %}
</h2>
164 <div class=
"eight columns">
165 <form action=
"{{ request.urlgen('mediagoblin.moderation.give_or_take_away_privilege',
166 user=user.username) }}"
168 <table class=
"admin_side_panel">
170 <th>{% trans %}Privilege{% endtrans %}
</th>
171 <th>{% trans %}User Has Privilege{% endtrans %}
</th>
173 {% for privilege in privileges %}
175 <td>{{ privilege.privilege_name }}
</td>
176 {% if privilege in user.all_privileges %}
177 <td class=
"user_with_privilege">
178 {% trans %}Yes{% endtrans %}{% else %}
179 <td class=
"user_without_privilege">
180 {% trans %}No{% endtrans %}{% endif %}
182 {% if request.user.has_privilege('admin') %}
184 {% if privilege in user.all_privileges %}
185 <input type=submit
id=
"{{ privilege.privilege_name }}"
186 class=
"submit_button button_action"
189 <input type=submit
id=
"{{ privilege.privilege_name }}"
190 class=
"submit_button button_action"
199 <input type=hidden name=privilege_name id=hidden_privilege_name
/>
202 <div class=
"eight columns">
203 <form method=POST
action=
"{{ request.urlgen(
204 'mediagoblin.moderation.ban_or_unban',
205 user=user.username) }}">
207 {% if request.user.has_privilege('admin') and not user_banned and
208 not user.id == request.user.id %}
209 {{ wtforms_util.render_divs(ban_form) }}
210 <input type=submit
class=
"button_action"
211 value=
"{% trans %}Ban User{% endtrans %}"
212 id=
"ban_user_submit" />
213 {% elif request.user.has_privilege('admin') and
214 not user.id == request.user.id %}
215 <input type=submit
class=
"button_action"
216 value=
"{% trans %}UnBan User{% endtrans %}" />
222 $(document).ready(function(){
223 $('.submit_button').click(function(){
224 $('#hidden_privilege_name').val($(this).attr('id'));
226 init_user_banned_form();
227 $('#ban_user_submit').click(function(){
228 submit_user_banned_form()