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 <div class=
"sixteen columns">
39 <a href=
"{{ request.urlgen('mediagoblin.moderation.users') }}"
40 class=
"return_to_panel button_action"
41 title=
"Return to Users Panel">
42 {% trans %}Return to Users Panel{% endtrans %}
</a>
46 <div class=
"eight columns">
49 <p>{% trans %}Sorry, no such user found.{% endtrans %}
</p>
50 {# User exists, but needs verification #}
51 {% elif not user.has_privilege('active') %}
52 <div class=
"profile_sidebar empty_space">
53 <h1>{% trans %}Email verification needed{% endtrans %}
</h1>
56 Someone has registered an account with this username, but it still has
63 {# Active(?) (or at least verified at some point) user, horray! #}
66 {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
67 {% if user_banned and user_banned.expiration_date %}
68 — {% trans expiration_date=user_banned.expiration_date -%}
69 BANNED until {{ expiration_date }}
71 {% elif user_banned %}
72 — {% trans %}Banned Indefinitely{% endtrans %}
75 {% if not user.url and not user.bio %}
76 <div class=
"profile_sidebar empty_space">
79 This user hasn't filled in their profile (yet).
83 <div class=
"profile_sidebar">
84 {% include
"mediagoblin/utils/profile.html" %}
85 {% if request.user and
86 (request.user.id == user.id or request.user.has_privilege('admin')) %}
87 <a href=
"{{ request.urlgen('mediagoblin.edit.profile',
88 user=user.username) }}">
89 {%- trans %}Edit profile{% endtrans -%}
94 <a href=
"{{ request.urlgen('mediagoblin.user_pages.collection_list',
95 user=user.username) }}">
96 {%- trans %}Browse collections{% endtrans -%}
103 <div class=
"eight columns">
105 {%- trans username=user.username -%}
106 Active Reports on {{ username }}
109 {% if reports.count() %}
110 <table class=
"admin_side_panel">
112 <th>{%- trans %}Report ID{% endtrans -%}
</th>
113 <th>{%- trans %}Reported Content{% endtrans -%}
</th>
114 <th>{%- trans %}Description of Report{% endtrans -%}
</th>
116 {% for report in reports %}
119 <img src=
"{{ request.staticdirect('/images/icon_clipboard.png') }}" />
120 <a href=
"{{ request.urlgen('mediagoblin.moderation.reports_detail',
121 report_id=report.id) }}">
122 {%- trans report_number=report.id -%}
123 Report #{{ report_number }}
128 {% if report.discriminator ==
"comment_report" %}
129 <a>{%- trans %}Reported Comment{% endtrans -%}
</a>
130 {% elif report.discriminator ==
"media_report" %}
131 <a>{%- trans %}Reported Media Entry{% endtrans -%}
</a>
134 <td>{{ report.report_content[:
21] }}
135 {% if report.report_content|count
>20 %}...{% endif %}
</td>
136 <td>{%- trans %}Resolve{% endtrans -%}
</td>
139 <tr><td></td><td></td>
142 {%- trans username=user.username -%}
143 No active reports filed on {{ username }}
148 <a href=
"{{ request.urlgen(
149 'mediagoblin.moderation.reports') }}?reported_user={{user.id}}">
151 username=user.username %}All reports on {{ username }}{% endtrans %}
</a>
153 <a href=
"{{ request.urlgen(
154 'mediagoblin.moderation.reports') }}?reporter={{user.id}}">
155 {%- trans username=user.username -%}
156 All reports that {{ username }} has filed
159 <span class=clear
></span>
163 <div class=
"row hell">
164 <h2>{% trans username=user.username -%}
165 {{ username }}'s Privileges{% endtrans %}
</h2>
166 <div class=
"eight columns">
167 <form action=
"{{ request.urlgen('mediagoblin.moderation.give_or_take_away_privilege',
168 user=user.username) }}"
170 <table class=
"admin_side_panel">
172 <th>{% trans %}Privilege{% endtrans %}
</th>
173 <th>{% trans %}User Has Privilege{% endtrans %}
</th>
175 {% for privilege in privileges %}
177 <td>{{ privilege.privilege_name }}
</td>
178 {% if privilege in user.all_privileges %}
179 <td class=
"user_with_privilege">
180 {% trans %}Yes{% endtrans %}{% else %}
181 <td class=
"user_without_privilege">
182 {% trans %}No{% endtrans %}{% endif %}
184 {% if request.user.has_privilege('admin') %}
186 {% if privilege in user.all_privileges %}
187 <input type=submit
id=
"{{ privilege.privilege_name }}"
188 class=
"submit_button button_action"
191 <input type=submit
id=
"{{ privilege.privilege_name }}"
192 class=
"submit_button button_action"
201 <input type=hidden name=privilege_name id=hidden_privilege_name
/>
204 <div class=
"eight columns">
205 <form method=POST
action=
"{{ request.urlgen(
206 'mediagoblin.moderation.ban_or_unban',
207 user=user.username) }}">
209 {% if request.user.has_privilege('admin') and not user_banned and
210 not user.id == request.user.id %}
211 {{ wtforms_util.render_divs(ban_form) }}
212 <input type=submit
class=
"button_action"
213 value=
"{% trans %}Ban User{% endtrans %}"
214 id=
"ban_user_submit" />
215 {% elif request.user.has_privilege('admin') and
216 not user.id == request.user.id %}
217 <input type=submit
class=
"button_action"
218 value=
"{% trans %}UnBan User{% endtrans %}" />
224 $(document).ready(function(){
225 $('.submit_button').click(function(){
226 $('#hidden_privilege_name').val($(this).attr('id'));
228 init_user_banned_form();
229 $('#ban_user_submit').click(function(){
230 submit_user_banned_form()