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') }}"></script>
35 {% block mediagoblin_content -%}
38 <p>{% trans %}Sorry, no such user found.{% endtrans %}
</p>
39 {# User exists, but needs verification #}
40 {% elif user.status ==
"needs_email_verification" %}
41 <div class=
"form_box">
42 <h1>{% trans %}Email verification needed{% endtrans %}
</h1>
45 Someone has registered an account with this username, but it still has
51 {% trans login_url=request.urlgen('mediagoblin.auth.login') -%}
52 If you are that person but you've lost your verification email, you can
53 <a href=
"{{ login_url }}">log in
</a> and resend it.
58 {# Active(?) (or at least verified at some point) user, horray! #}
60 <a href=
"{{ request.urlgen('mediagoblin.moderation.users') }}"
61 class=
"return_to_panel button_action"
62 title=
"Return to Users Panel">
63 {% trans %}Return to Users Panel{% endtrans %}
</a>
65 {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
66 {% if user_banned and user_banned.expiration_date %}
67 — BANNED until {{ user_banned.expiration_date }}
68 {% elif user_banned %}
69 — Banned Indefinitely
72 {% if not user.url and not user.bio %}
73 <div class=
"profile_sidebar empty_space">
76 This user hasn't filled in their profile (yet).
80 <div class=
"profile_sidebar">
81 {% include
"mediagoblin/utils/profile.html" %}
82 {% if request.user and
83 (request.user.id == user.id or request.user.has_privilege('admin')) %}
84 <a href=
"{{ request.urlgen('mediagoblin.edit.profile',
85 user=user.username) }}">
86 {%- trans %}Edit profile{% endtrans -%}
91 <a href=
"{{ request.urlgen('mediagoblin.user_pages.collection_list',
92 user=user.username) }}">
93 {%- trans %}Browse collections{% endtrans -%}
99 <h2>{%- trans %}Active Reports on {% endtrans -%}{{ user.username }}
</h2>
100 {% if reports.count() %}
101 <table class=
"admin_side_panel">
103 <th>{%- trans %}Report ID{% endtrans -%}
</th>
104 <th>{%- trans %}Reported Content{% endtrans -%}
</th>
105 <th>{%- trans %}Description of Report{% endtrans -%}
</th>
107 {% for report in reports %}
110 <img src=
"{{ request.staticdirect('/images/icon_clipboard.png') }}" />
111 <a href=
"{{ request.urlgen('mediagoblin.moderation.reports_detail',
112 report_id=report.id) }}">
113 {%- trans %}Report #{% endtrans -%}{{ report.id }}
117 {% if report.discriminator ==
"comment_report" %}
118 <a>{%- trans %}Reported Comment{% endtrans -%}
</a>
119 {% elif report.discriminator ==
"media_report" %}
120 <a>{%- trans %}Reported Media Entry{% endtrans -%}
</a>
123 <td>{{ report.report_content[:
21] }}
124 {% if report.report_content|count
>20 %}...{% endif %}
</td>
125 <td>{%- trans %}Resolve{% endtrans -%}
</td>
128 <tr><td></td><td></td>
131 {%- trans %}No active reports filed on {% endtrans -%} {{ user.username }}
133 <a href=
"{{ request.urlgen('mediagoblin.moderation.reports') }}?active_reported_user={{user.id}}&closed_reported_user={{user.id}}"
134 class=
"right_align">{{ user.username }}'s report history
</a>
135 <span class=clear
></span>
136 <h2>{{ user.username }}'s Privileges
</h2>
137 <form method=POST
action=
"{{ request.urlgen(
138 'mediagoblin.moderation.ban_or_unban',
139 user=user.username) }}" class=
"right_align">
141 {% if request.user.has_privilege('admin') and not user_banned and
142 not user.id == request.user.id %}
143 {{ wtforms_util.render_divs(ban_form) }}
144 <input type=submit
class=
"button_action"
145 value=
"{% trans %}Ban User{% endtrans %}"
146 id=
"ban_user_submit" />
147 {% elif request.user.has_privilege('admin') and
148 not user.id == request.user.id %}
149 <input type=submit
class=
"button_action right_align"
150 value=
"{% trans %}UnBan User{% endtrans %}" />
153 <form action=
"{{ request.urlgen('mediagoblin.moderation.give_or_take_away_privilege',
154 user=user.username) }}"
156 <table class=
"admin_side_panel">
158 <th>{% trans %}Privilege{% endtrans %}
</th>
159 <th>{% trans %}User Has Privilege{% endtrans %}
</th>
161 {% for privilege in privileges %}
163 <td>{{ privilege.privilege_name }}
</td>
164 {% if privilege in user.all_privileges %}
165 <td class=
"user_with_privilege">
167 <td class=
"user_without_privilege">
170 {% if request.user.has_privilege('admin') %}
172 {% if privilege in user.all_privileges %}
173 <input type=submit
id=
"{{ privilege.privilege_name }}"
174 class=
"submit_button button_action"
177 <input type=submit
id=
"{{ privilege.privilege_name }}"
178 class=
"submit_button button_action"
187 <input type=hidden name=privilege_name id=hidden_privilege_name
/>
191 $(document).ready(function(){
192 $('.submit_button').click(function(){
193 $('#hidden_privilege_name').val($(this).attr('id'));
195 init_user_banned_form();
196 $('#ban_user_submit').click(function(){
197 submit_user_banned_form()