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 -%}
39 <p>{% trans %}Sorry, no such user found.{% endtrans %}
</p>
40 {# User exists, but needs verification #}
41 {% elif not user.has_privilege('active') %}
42 <div class=
"profile_sidebar empty_space">
43 <h1>{% trans %}Email verification needed{% endtrans %}
</h1>
46 Someone has registered an account with this username, but it still has
53 {# Active(?) (or at least verified at some point) user, horray! #}
55 <a href=
"{{ request.urlgen('mediagoblin.moderation.users') }}"
56 class=
"return_to_panel button_action"
57 title=
"Return to Users Panel">
58 {% trans %}Return to Users Panel{% endtrans %}
</a>
60 {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
61 {% if user_banned and user_banned.expiration_date %}
62 — {% trans expiration_date=user_banned.expiration_date %}
63 BANNED until {{ expiration_date }}
65 {% elif user_banned %}
66 — {% trans %}Banned Indefinitely{% endtrans %}
69 {% if not user.url and not user.bio %}
70 <div class=
"profile_sidebar empty_space">
73 This user hasn't filled in their profile (yet).
77 <div class=
"profile_sidebar">
78 {% include
"mediagoblin/utils/profile.html" %}
79 {% if request.user and
80 (request.user.id == user.id or request.user.has_privilege('admin')) %}
81 <a href=
"{{ request.urlgen('mediagoblin.edit.profile',
82 user=user.username) }}">
83 {%- trans %}Edit profile{% endtrans -%}
88 <a href=
"{{ request.urlgen('mediagoblin.user_pages.collection_list',
89 user=user.username) }}">
90 {%- trans %}Browse collections{% endtrans -%}
97 {%- trans username=user.username %}
98 Active Reports on {{ username }}
101 {% if reports.count() %}
102 <table class=
"admin_side_panel">
104 <th>{%- trans %}Report ID{% endtrans -%}
</th>
105 <th>{%- trans %}Reported Content{% endtrans -%}
</th>
106 <th>{%- trans %}Description of Report{% endtrans -%}
</th>
108 {% for report in reports %}
111 <img src=
"{{ request.staticdirect('/images/icon_clipboard.png') }}" />
112 <a href=
"{{ request.urlgen('mediagoblin.moderation.reports_detail',
113 report_id=report.id) }}">
114 {%- trans report_number=report.id %}
115 Report #{{ report_number }}
120 {% if report.discriminator ==
"comment_report" %}
121 <a>{%- trans %}Reported Comment{% endtrans -%}
</a>
122 {% elif report.discriminator ==
"media_report" %}
123 <a>{%- trans %}Reported Media Entry{% endtrans -%}
</a>
126 <td>{{ report.report_content[:
21] }}
127 {% if report.report_content|count
>20 %}...{% endif %}
</td>
128 <td>{%- trans %}Resolve{% endtrans -%}
</td>
131 <tr><td></td><td></td>
135 username=user.username %}No active reports filed on {{ username }}
138 <span class=
"right_align">
139 <a href=
"{{ request.urlgen(
140 'mediagoblin.moderation.reports') }}?reported_user={{user.id}}">
142 username=user.username %}All reports on {{ username }}{% endtrans %}
</a>
144 <a href=
"{{ request.urlgen(
145 'mediagoblin.moderation.reports') }}?reporter={{user.id}}">
147 username=user.username %}All reports that {{ username }} has filed
150 <span class=clear
></span>
151 <h2>{{ user.username }}'s Privileges
</h2>
152 <form method=POST
action=
"{{ request.urlgen(
153 'mediagoblin.moderation.ban_or_unban',
154 user=user.username) }}" class=
"right_align">
156 {% if request.user.has_privilege('admin') and not user_banned and
157 not user.id == request.user.id %}
158 {{ wtforms_util.render_divs(ban_form) }}
159 <input type=submit
class=
"button_action"
160 value=
"{% trans %}Ban User{% endtrans %}"
161 id=
"ban_user_submit" />
162 {% elif request.user.has_privilege('admin') and
163 not user.id == request.user.id %}
164 <input type=submit
class=
"button_action right_align"
165 value=
"{% trans %}UnBan User{% endtrans %}" />
168 <form action=
"{{ request.urlgen('mediagoblin.moderation.give_or_take_away_privilege',
169 user=user.username) }}"
171 <table class=
"admin_side_panel">
173 <th>{% trans %}Privilege{% endtrans %}
</th>
174 <th>{% trans %}User Has Privilege{% endtrans %}
</th>
176 {% for privilege in privileges %}
178 <td>{{ privilege.privilege_name }}
</td>
179 {% if privilege in user.all_privileges %}
180 <td class=
"user_with_privilege">
181 {% trans %}Yes{% endtrans %}{% else %}
182 <td class=
"user_without_privilege">
183 {% trans %}No{% endtrans %}{% endif %}
185 {% if request.user.has_privilege('admin') %}
187 {% if privilege in user.all_privileges %}
188 <input type=submit
id=
"{{ privilege.privilege_name }}"
189 class=
"submit_button button_action"
192 <input type=submit
id=
"{{ privilege.privilege_name }}"
193 class=
"submit_button button_action"
202 <input type=hidden name=privilege_name id=hidden_privilege_name
/>
206 $(document).ready(function(){
207 $('.submit_button').click(function(){
208 $('#hidden_privilege_name').val($(this).attr('id'));
210 init_user_banned_form();
211 $('#ban_user_submit').click(function(){
212 submit_user_banned_form()