aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/banned.html28
-rw-r--r--mediagoblin/templates/mediagoblin/base.html12
-rw-r--r--mediagoblin/templates/mediagoblin/meta/code_of_conduct.html46
-rw-r--r--mediagoblin/templates/mediagoblin/meta/reports_details.html17
-rw-r--r--mediagoblin/templates/mediagoblin/meta/reports_panel.html17
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/media_panel.html (renamed from mediagoblin/templates/mediagoblin/admin/panel.html)0
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/report.html194
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/report_panel.html122
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/user.html186
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/user_panel.html61
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection.html2
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html17
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/report.html83
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/user.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/collection_gallery.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/report.html33
16 files changed, 814 insertions, 8 deletions
diff --git a/mediagoblin/templates/mediagoblin/banned.html b/mediagoblin/templates/mediagoblin/banned.html
new file mode 100644
index 00000000..4eda0540
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/banned.html
@@ -0,0 +1,28 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{% extends "mediagoblin/base.html" %}
+
+{% block title %}You are Banned.{% endblock %}
+
+{% block mediagoblin_content %}
+ <img class="right_align" src="{{ request.staticdirect('/images/404.png') }}"
+ alt="{% trans %}Image of goblin stressing out{% endtrans %}" />
+ <h1>You have been banned until {{ expiration_date }}</h1>
+ <p>{{ reason|safe }}</p>
+ <div class="clear"></div>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html
index f7e2dff0..7d53585b 100644
--- a/mediagoblin/templates/mediagoblin/base.html
+++ b/mediagoblin/templates/mediagoblin/base.html
@@ -127,12 +127,18 @@
<a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}">
{%- trans %}Create new collection{% endtrans -%}
</a>
- {% if request.user.is_admin %}
+ {% if request.user.has_privilege('admin','moderator') %}
<p>
- <span class="dropdown_title">Admin powers:</span>
- <a href="{{ request.urlgen('mediagoblin.admin.panel') }}">
+ <span class="dropdown_title">Moderation powers:</span>
+ <a href="{{ request.urlgen('mediagoblin.moderation.media_panel') }}">
{%- trans %}Media processing panel{% endtrans -%}
</a>
+ <a href="{{ request.urlgen('mediagoblin.moderation.users') }}">
+ {%- trans %}User management panel{% endtrans -%}
+ </a>
+ <a href="{{ request.urlgen('mediagoblin.moderation.reports') }}">
+ {%- trans %}Report management panel{% endtrans -%}
+ </a>
</p>
{% endif %}
{% include 'mediagoblin/fragments/header_notifications.html' %}
diff --git a/mediagoblin/templates/mediagoblin/meta/code_of_conduct.html b/mediagoblin/templates/mediagoblin/meta/code_of_conduct.html
new file mode 100644
index 00000000..e8233ad3
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/meta/code_of_conduct.html
@@ -0,0 +1,46 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{% extends "mediagoblin/base.html" %}
+
+{% block title %}
+ Code of Conduct
+{% endblock %}
+
+{% block mediagoblin_content -%}
+<h2>{% trans %}Code of Conduct for this Website{% endtrans %}</h2>
+
+{# Suggested layout for this page:
+<ol id="code_of_conduct_list">
+ <li> Item #1 </li>
+ <li>
+ Item #2
+ <ol class="nested_sublist">
+ <li>Sub-Item #1</li>
+ <li>Sub-Item #2</li>
+ <li>
+ Sub-Item #3
+ <ol class="nested_sublist">
+ <li>Sub-Subitem #1</li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ <li>Item #3 </li>
+</ol>
+#}
+{% endblock -%}
diff --git a/mediagoblin/templates/mediagoblin/meta/reports_details.html b/mediagoblin/templates/mediagoblin/meta/reports_details.html
new file mode 100644
index 00000000..6fa5ae59
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/meta/reports_details.html
@@ -0,0 +1,17 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
diff --git a/mediagoblin/templates/mediagoblin/meta/reports_panel.html b/mediagoblin/templates/mediagoblin/meta/reports_panel.html
new file mode 100644
index 00000000..6fa5ae59
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/meta/reports_panel.html
@@ -0,0 +1,17 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
diff --git a/mediagoblin/templates/mediagoblin/admin/panel.html b/mediagoblin/templates/mediagoblin/moderation/media_panel.html
index 1c3c866e..1c3c866e 100644
--- a/mediagoblin/templates/mediagoblin/admin/panel.html
+++ b/mediagoblin/templates/mediagoblin/moderation/media_panel.html
diff --git a/mediagoblin/templates/mediagoblin/moderation/report.html b/mediagoblin/templates/mediagoblin/moderation/report.html
new file mode 100644
index 00000000..04788f05
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/report.html
@@ -0,0 +1,194 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{%- extends "mediagoblin/base.html" %}
+{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+
+{%- block mediagoblin_content %}
+{% if not report %}
+ Sorry, no such report found.
+{% else %}
+ <a href="{{ request.urlgen('mediagoblin.moderation.reports') }}"
+ class="return_to_panel button_action"
+ title="Return to Reports Panel">
+ {% trans %}Return to Reports Panel{% endtrans %}</a>
+ <h2>{% trans %}Report{% endtrans %} #{{ report.id }}</h2>
+ {% if report.is_comment_report() or
+ (report.is_archived_report() and report.comment) %}
+
+ {% trans %}Reported comment{% endtrans %}:
+ {% set comment = report.comment %}
+ {% set reported_user = comment.get_author %}
+ <div id="comment-{{ comment.id }}"
+ class="comment_wrapper">
+ <div class="comment_author">
+ <img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
+ <a href="{{ request.urlgen('mediagoblin.moderation.users_detail',
+ user=comment.get_author.username) }}"
+ class="comment_authorlink">
+ {{- reported_user.username -}}
+ </a>
+ <a href="{{ request.urlgen(
+ 'mediagoblin.user_pages.media_home.view_comment',
+ comment=comment.id,
+ user=comment.get_media_entry.get_uploader.username,
+ media=comment.get_media_entry.slug_or_id) }}#comment"
+ class="comment_whenlink">
+ <span title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
+ {%- trans formatted_time=timesince(comment.created) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span></a>:
+ </div>
+ <div class=comment_content>
+ {% autoescape False %}
+ {{ comment.content_html }}
+ {% endautoescape %}
+ </div>
+ </div>
+ {% elif report.is_media_entry_report() or
+ (report.is_archived_report() and report.media_entry) %}
+
+ {% set media_entry = report.media_entry %}
+ <div class="media_thumbnail">
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home',
+ user=media_entry.get_uploader.username,
+ media=media_entry.slug_or_id) }}">
+ <img src="{{ media_entry.thumb_url}}"/></a>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home',
+ user=media_entry.get_uploader.username,
+ media=media_entry.slug_or_id) }}" class=thumb_entry_title>
+ {{ media_entry.title }}</a>
+ </div>
+ <div class=clear></div>
+ <p>
+ {% trans user_name=report.reported_user.username,
+ user_url=request.urlgen(
+ 'mediagoblin.moderation.users_detail',
+ user=report.reporter.username) %}
+ ❖ Reported media by <a href="{{ user_url }}">{{ user_name }}</a>
+ {% endtrans %}
+ </p>
+ <div class=clear></div>
+ {% else %}
+ <h2>{% trans user_url=request.urlgen(
+ 'mediagoblin.moderation.users_detail',
+ user=report.reporter.username),
+ user_name=report.reported_user.username %}
+ CONTENT BY
+ <a href="{{ user_url }}"> {{ user_name }}</a>
+ HAS BEEN DELETED
+ {% endtrans %}
+ </h2>
+ {% endif %}
+ Reason for report:
+ <div id="report-{{ report.id }}"
+ class="report_wrapper">
+ <div class="report_author">
+ <img src="{{ request.staticdirect(
+ '/images/icon_clipboard_alert.png') }}"
+ alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
+ Distributed by the GNOME project http://www.gnome.org" />
+ <a href="{{ request.urlgen('mediagoblin.moderation.users_detail',
+ user=report.reporter.username) }}"
+ class="report_authorlink">
+ {{- report.reporter.username -}}
+ </a>
+ <a href="{{ request.urlgen('mediagoblin.moderation.reports_detail',
+ report_id=report.id) }}"
+ class="report_whenlink">
+ <span title='{{- report.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
+ {%- trans formatted_time=timesince(report.created) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span>
+ </a>
+ </div>
+ <div class="report_content">
+ {{ report.report_content }}
+ </div>
+ </div>
+ {% if not report.is_archived_report() and not (report.reported_user.has_privilege('admin') and not request.user.has_privilege('admin')) %}
+ <input type=button value=Resolve id=open_resolution_form />
+ <form action="" method="POST" id=resolution_form>
+ {{ wtforms_util.render_divs(form) }}
+ {{ csrf_token }}
+ <input type=submit id="submit_this_report" value="Resolve This Report"/>
+ </form>
+
+
+ <script>
+$(document).ready(function() {
+ hidden_input_names = {
+ 'takeaway':['take_away_privileges'],
+ 'userban':['user_banned_until','why_user_was_banned'],
+ 'sendmessage':['message_to_user']
+}
+
+ $('form#resolution_form').hide()
+ $('#user_banned_until').val("YYYY-MM-DD")
+ $('#open_resolution_form').click(function() {
+ $('form#resolution_form').toggle();
+ $.each(hidden_input_names, function(key, list){
+ $.each(list, function(index, name){
+ $('label[for='+name+']').hide();
+ $('#'+name).hide();
+ });
+ });
+ });
+ $('#action_to_resolve').change(function() {
+ $('ul#action_to_resolve li input:checked').each(function() {
+ $.each(hidden_input_names[$(this).val()], function(index, name){
+ $('label[for='+name+']').show();
+ $('#'+name).show();
+ });
+ });
+ $('ul#action_to_resolve li input:not(:checked)').each(function() {
+ $.each(hidden_input_names[$(this).val()], function(index, name){
+ $('label[for='+name+']').hide();
+ $('#'+name).hide();
+ });
+ });
+ });
+ $("#user_banned_until").focus(function() {
+ $(this).val("");
+ $(this).unbind('focus');
+ });
+ $("#submit_this_report").click(function(){
+ if ($("#user_banned_until").val() == 'YYYY-MM-DD'){
+ $("#user_banned_until").val("");
+ }
+ });
+ });
+ </script>
+ {% elif not (report.reported_user.has_privilege('admin')) %}
+ <h2><img src="{{ request.staticdirect('/images/icon_clipboard.png') }}"
+ alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
+ Distributed by the GNOME project http://www.gnome.org" />
+ {% trans %}Status{% endtrans %}:
+ </h2>
+ <b>{% trans %}RESOLVED{% endtrans %}</b>
+ {{ report.resolved.strftime("%I:%M%p %Y-%m-%d") }}
+ {% autoescape False %}
+ <p>{{ report.result }}</p>
+ {% endautoescape %}
+ {% else %}
+ <input type=button disabled=disabled value="Resolve This Report"/>
+ <p>You cannot take action against an administrator</p>
+ {% endif %}
+{% endif %}
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/moderation/report_panel.html b/mediagoblin/templates/mediagoblin/moderation/report_panel.html
new file mode 100644
index 00000000..2818eb80
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/report_panel.html
@@ -0,0 +1,122 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{% extends "mediagoblin/base.html" %}
+
+{% block title -%}
+ {% trans %}Report panel{% endtrans %} &mdash; {{ super() }}
+{%- endblock %}
+
+{% block mediagoblin_content %}
+
+<h1>{% trans %}Report panel{% endtrans %}</h1>
+
+<p>
+ {% trans %}
+ Here you can look up open reports that have been filed by users.
+ {% endtrans %}
+</p>
+
+<h2>{% trans %}Active Reports Filed{% endtrans %}</h2>
+
+{% if report_list.count() %}
+ <table class="admin_panel processing">
+ <tr>
+ <th></th>
+ <th>{% trans %}Offender{% endtrans %}</th>
+ <th>{% trans %}When Reported{% endtrans %}</th>
+ <th>{% trans %}Reported By{% endtrans %}</th>
+ <th>{% trans %}Reason{% endtrans %}</th>
+ </tr>
+ {% for report in report_list %}
+ <tr>
+ {% if report.discriminator == "comment_report" %}
+ <td>
+ <img
+ src="{{ request.staticdirect('/images/icon_clipboard_alert.png') }}"
+ alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
+ Distributed by the GNOME project http://www.gnome.org" />
+ <a href="{{ request.urlgen(
+ 'mediagoblin.moderation.reports_detail',
+ report_id=report.id) }}">
+ {% trans report_id=report.id %}
+ Comment Report #{{ report_id }}
+ {% endtrans %}
+ </a>
+ </td>
+ {% elif report.discriminator == "media_report" %}
+ <td>
+ <img
+ src="{{ request.staticdirect('/images/icon_clipboard_alert.png') }}"
+ alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
+ Distributed by the GNOME project http://www.gnome.org" />
+ <a href="{{ request.urlgen(
+ 'mediagoblin.moderation.reports_detail',
+ report_id=report.id) }}">
+ {% trans report_id=report.id %}
+ Media Report #{{ report_id }}
+ {% endtrans %}
+ </a>
+ </td>
+ {% endif %}
+ <td>{{ report.reported_user.username }}</td>
+ <td>{{ report.created.strftime("%F %R") }}</td>
+ <td>{{ report.reporter.username }}</td>
+ <td>{{ report.report_content[0:20] }}...</td>
+ </tr>
+ {% endfor %}
+ </table>
+{% else %}
+ <p><em>{% trans %}No open reports found.{% endtrans %}</em></p>
+{% endif %}
+<h2>{% trans %}Closed Reports{% endtrans %}</h2>
+{% if closed_report_list.count() %}
+ <table class="media_panel processing">
+ <tr>
+ <th></th>
+ <th>{% trans %}Resolved{% endtrans %}</th>
+ <th>{% trans %}Offender{% endtrans %}</th>
+ <th>{% trans %}Action Taken{% endtrans %}</th>
+ <th>{% trans %}Reported By{% endtrans %}</th>
+ <th>{% trans %}Reason{% endtrans %}</th>
+ </tr>
+ {% for report in closed_report_list %}
+ <tr>
+ <td>
+ <img
+ src="{{ request.staticdirect('/images/icon_clipboard.png') }}"
+ alt="Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license.
+ Distributed by the GNOME project http://www.gnome.org" />
+ <a href="{{ request.urlgen('mediagoblin.moderation.reports_detail',
+ report_id=report.id) }}">
+ {% trans report_id=report.id %}
+ Closed Report #{{ report_id }}
+ {% endtrans %}
+ </a>
+ </td>
+ <td>{{ report.resolved.strftime("%F %R") }}</td>
+ <td>{{ report.reported_user.username }}</td>
+ <td>{{ report.created.strftime("%F %R") }}</td>
+ <td>{{ report.reporter.username }}</td>
+ <td>{{ report.report_content[:15] }}...</td>
+ </tr>
+ {% endfor %}
+ </table>
+{% else %}
+ <p><em>{% trans %}No closed reports found.{% endtrans %}</em></p>
+{% endif %}
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/moderation/user.html b/mediagoblin/templates/mediagoblin/moderation/user.html
new file mode 100644
index 00000000..ef48fe54
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/user.html
@@ -0,0 +1,186 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{% extends "mediagoblin/base.html" %}
+
+
+{% block title %}
+ {%- if user -%}
+ {%- trans username=user.username -%}
+ User: {{ username }}
+ {%- endtrans %} &mdash; {{ super() }}
+ {%- else -%}
+ {{ super() }}
+ {%- endif -%}
+{% endblock %}
+
+
+{% block mediagoblin_content -%}
+ {# If no user... #}
+ {% if not user %}
+ <p>{% trans %}Sorry, no such user found.{% endtrans %}</p>
+ {# User exists, but needs verification #}
+ {% elif user.status == "needs_email_verification" %}
+ <div class="form_box">
+ <h1>{% trans %}Email verification needed{% endtrans %}</h1>
+ <p>
+ {% trans -%}
+ Someone has registered an account with this username, but it still has
+ to be activated.
+ {%- endtrans %}
+ </p>
+
+ <p>
+ {% trans login_url=request.urlgen('mediagoblin.auth.login') -%}
+ If you are that person but you've lost your verification email, you can
+ <a href="{{ login_url }}">log in</a> and resend it.
+ {%- endtrans %}
+ </p>
+ </div>
+
+ {# Active(?) (or at least verified at some point) user, horray! #}
+ {% else %}
+ <a href="{{ request.urlgen('mediagoblin.moderation.users') }}"
+ class="return_to_panel button_action"
+ title="Return to Users Panel">
+ {% trans %}Return to Users Panel{% endtrans %}</a>
+ <h1>
+ {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
+ {% if user_banned and user_banned.expiration_date %}
+ &mdash; BANNED until {{ user_banned.expiration_date }}
+ {% elif user_banned %}
+ &mdash; Banned Indefinitely
+ {% endif %}
+ </h1>
+ {% if not user.url and not user.bio %}
+ <div class="profile_sidebar empty_space">
+ <p>
+ {% trans -%}
+ This user hasn't filled in their profile (yet).
+ {%- endtrans %}
+ </p>
+ {% else %}
+ <div class="profile_sidebar">
+ {% include "mediagoblin/utils/profile.html" %}
+ {% if request.user and
+ (request.user.id == user.id or request.user.has_privilege('admin')) %}
+ <a href="{{ request.urlgen('mediagoblin.edit.profile',
+ user=user.username) }}">
+ {%- trans %}Edit profile{% endtrans -%}
+ </a>
+ {% endif %}
+ {% endif %}
+ <p>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.collection_list',
+ user=user.username) }}">
+ {%- trans %}Browse collections{% endtrans -%}
+ </a>
+ </p>
+ </div>
+ {% endif %}
+ {% if user %}
+ <h2>{%- trans %}Active Reports on {% endtrans -%}{{ user.username }}</h2>
+ {% if reports.count() %}
+ <table class="admin_side_panel">
+ <tr>
+ <th>{%- trans %}Report ID{% endtrans -%}</th>
+ <th>{%- trans %}Reported Content{% endtrans -%}</th>
+ <th>{%- trans %}Description of Report{% endtrans -%}</th>
+ </tr>
+ {% for report in reports %}
+ <tr>
+ <td>
+ <img src="{{ request.staticdirect('/images/icon_clipboard.png') }}" />
+ <a href="{{ request.urlgen('mediagoblin.moderation.reports_detail',
+ report_id=report.id) }}">
+ {%- trans %}Report #{% endtrans -%}{{ report.id }}
+ </a>
+ </td>
+ <td>
+ {% if report.discriminator == "comment_report" %}
+ <a>{%- trans %}Reported Comment{% endtrans -%}</a>
+ {% elif report.discriminator == "media_report" %}
+ <a>{%- trans %}Reported Media Entry{% endtrans -%}</a>
+ {% endif %}
+ </td>
+ <td>{{ report.report_content[:21] }}
+ {% if report.report_content|count >20 %}...{% endif %}</td>
+ <td>{%- trans %}Resolve{% endtrans -%}</td>
+ </tr>
+ {% endfor %}
+ <tr><td></td><td></td>
+ </table>
+ {% else %}
+ {%- trans %}No active reports filed on {% endtrans -%} {{ user.username }}
+ {% endif %}
+ <a class="right_align">{{ user.username }}'s report history</a>
+ <span class=clear></span>
+ <h2>{{ user.username }}'s Privileges</h2>
+ {% if request.user.has_privilege('admin') and not user_banned and
+ not user.id == request.user.id %}
+ <input type=button class="button_action right_align"
+ value="Ban User" />
+ {% elif request.user.has_privilege('admin') and
+ not user.id == request.user.id %}
+ <input type=button class="button_action right_align"
+ value="UnBan User" />
+ {% endif %}
+ <form action="{{ request.urlgen('mediagoblin.moderation.give_or_take_away_privilege',
+ user=user.username) }}"
+ method=post >
+ <table class="admin_side_panel">
+ <tr>
+ <th>{% trans %}Privilege{% endtrans %}</th>
+ <th>{% trans %}User Has Privilege{% endtrans %}</th>
+ </tr>
+ {% for privilege in privileges %}
+ <tr>
+ <td>{{ privilege.privilege_name }}</td>
+ {% if privilege in user.all_privileges %}
+ <td class="user_with_privilege">
+ Yes{% else %}
+ <td class="user_without_privilege">
+ No{% endif %}
+ </td>
+ {% if request.user.has_privilege('admin') %}
+ <td>
+ {% if privilege in user.all_privileges %}
+ <input type=submit id="{{ privilege.privilege_name }}"
+ class="submit_button button_action"
+ value =" -" />
+ {% else %}
+ <input type=submit id="{{ privilege.privilege_name }}"
+ class="submit_button button_action"
+ value ="+" />
+ {% endif %}
+ </td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ {{ csrf_token }}
+ <input type=hidden name=privilege_name id=hidden_privilege_name />
+ </form>
+ {% endif %}
+ <script>
+$(document).ready(function(){
+ $('.submit_button').click(function(){
+ $('#hidden_privilege_name').val($(this).attr('id'));
+ });
+});
+ </script>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/moderation/user_panel.html b/mediagoblin/templates/mediagoblin/moderation/user_panel.html
new file mode 100644
index 00000000..6762a844
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/user_panel.html
@@ -0,0 +1,61 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{% extends "mediagoblin/base.html" %}
+
+{% block title -%}
+ {% trans %}User panel{% endtrans %} &mdash; {{ super() }}
+{%- endblock %}
+
+{% block mediagoblin_content %}
+
+<h1>{% trans %}User panel{% endtrans %}</h1>
+
+<p>
+ {% trans %}
+ Here you can look up users in order to take punitive actions on them.
+ {% endtrans %}
+</p>
+
+<h2>{% trans %}Active Users{% endtrans %}</h2>
+
+{% if user_list.count() %}
+ <table class="admin_panel processing">
+ <tr>
+ <th>{% trans %}ID{% endtrans %}</th>
+ <th>{% trans %}Username{% endtrans %}</th>
+ <th>{% trans %}When Joined{% endtrans %}</th>
+ <th>{% trans %}# of Comments Posted{% endtrans %}</th>
+ </tr>
+ {% for user in user_list %}
+ <tr>
+ <td>{{ user.id }}</td>
+ <td>
+ <a href="{{ request.urlgen('mediagoblin.moderation.users_detail',
+ user= user.username) }}">
+ {{ user.username }}
+ </a>
+ </td>
+ <td>{{ user.created.strftime("%F %R") }}</td>
+ <td>{{ user.posted_comments.count() }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+{% else %}
+ <p><em>{% trans %}No users found.{% endtrans %}</em></p>
+{% endif %}
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection.html b/mediagoblin/templates/mediagoblin/user_pages/collection.html
index 5a7baadd..87635dcb 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection.html
@@ -45,7 +45,7 @@
{%- endtrans %}
</h1>
{% if request.user and (collection.creator == request.user.id or
- request.user.is_admin) %}
+ request.user.has_privilege(u'admin')) %}
{% set edit_url = request.urlgen('mediagoblin.edit.edit_collection',
user=collection.get_creator.username,
collection=collection.slug) %}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index 39935b40..e161afc9 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -72,7 +72,7 @@
</h2>
{% if request.user and
(media.uploader == request.user.id or
- request.user.is_admin) %}
+ request.user.has_privilege('admin')) %}
{% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
user= media.get_uploader.username,
media_id=media.id) %}
@@ -146,6 +146,17 @@
{{ comment.content_html }}
{%- endautoescape %}
</div>
+ <div>
+ <a {% if not request.user -%}
+ href="{{ request.urlgen('mediagoblin.auth.login') }}"
+ {%- else %}
+ href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_comment',
+ user=media.get_uploader.username,
+ media=media.slug_or_id,
+ comment=comment.id) }}"
+ {%- endif %}>
+ {% trans %} Report {% endtrans %}</a>
+ </div>
</li>
{% endfor %}
</ul>
@@ -170,6 +181,8 @@
{% include "mediagoblin/utils/collections.html" %}
+ {% include "mediagoblin/utils/report.html" %}
+
{% include "mediagoblin/utils/license.html" %}
{% include "mediagoblin/utils/exif.html" %}
@@ -189,7 +202,7 @@
{%- if app_config['allow_attachments']
and request.user
and (media.uploader == request.user.id
- or request.user.is_admin) %}
+ or request.user.has_privilege('admin')) %}
{%- if not media.attachment_files|count %}
<h3>{% trans %}Attachments{% endtrans %}</h3>
{%- endif %}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/report.html b/mediagoblin/templates/mediagoblin/user_pages/report.html
new file mode 100644
index 00000000..cd5e6f59
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/user_pages/report.html
@@ -0,0 +1,83 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+{%- extends "mediagoblin/base.html" %}
+{%- import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+{%- block mediagoblin_content -%}
+{% trans %}<h2>File a Report</h2>{% endtrans %}
+<form action="" method=POST >
+ {% if comment is defined %}
+ <h3>{% trans %}Reporting this Comment{% endtrans %}</h3>
+ {%- set comment_author = comment.get_author %}
+ {%- set comment_author_url = request.urlgen(
+ 'mediagoblin.user_pages.user_home',
+ user=comment_author.username) %}
+ {%- set comment_url = request.urlgen(
+ 'mediagoblin.user_pages.media_home.view_comment',
+ comment=comment.id,
+ user=media.get_uploader.username,
+ media=media.slug_or_id) %}
+ <div id="comment-{{ comment.id }}"
+ class="comment_wrapper">
+ <div class="comment_author">
+ <img
+ src="{{ request.staticdirect('/images/icon_comment.png') }}" />
+ <a href="{{ comment_author_url }}"
+ class="comment_authorlink">
+ {{- comment_author.username -}}
+ </a>
+ <a href="{{ comment_url }}"
+ class="comment_whenlink">
+ <span
+ title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
+
+ {%- trans formatted_time=timesince(comment.created) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span></a>:
+ </div>
+ <div class="comment_content">
+ {% autoescape False -%}
+ {{ comment.content_html }}
+ {%- endautoescape %}
+ </div>
+ </div>
+ {% elif media is defined %}
+ <h3>{% trans %}Reporting this Media Entry{% endtrans %}</h3>
+ <div class="media_thumbnail">
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}">
+ <img src="{{ media.thumb_url }}"/></a>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ class=thumb_entry_title>{{ media.title }}</a>
+ </div>
+ <div class=clear></div>
+ {%- trans user_url = request.urlgen('mediagoblin.user_pages.user_home', user=media.get_uploader.username),
+ username = media.get_uploader.username %}
+ ❖ Published by <a href="{{ user_url }}"
+ class="comment_authorlink">{{ username }}</a>
+ {% endtrans %}
+ {%- endif %}
+
+ {{- wtforms_util.render_divs(form) }}
+ {{ csrf_token }}
+ <input type=submit value="{% trans %}File Report {% endtrans %}" />
+</form>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html
index 71acd66c..de92fb5e 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/user.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/user.html
@@ -111,7 +111,7 @@
<div class="profile_sidebar">
{% include "mediagoblin/utils/profile.html" %}
{% if request.user and
- (request.user.id == user.id or request.user.is_admin) %}
+ (request.user.id == user.id or request.user.has_privilege('admin')) %}
<a href="{{ request.urlgen('mediagoblin.edit.profile',
user=user.username) }}">
{%- trans %}Edit profile{% endtrans -%}
diff --git a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html
index dcc59244..24bf6832 100644
--- a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html
@@ -39,7 +39,7 @@
{% endif %}
{% if request.user and
(item.in_collection.creator == request.user.id or
- request.user.is_admin) %}
+ request.user.has_privilege(u'admin')) %}
{%- set remove_url=request.urlgen(
'mediagoblin.user_pages.collection_item_confirm_remove',
user=item.in_collection.get_creator.username,
diff --git a/mediagoblin/templates/mediagoblin/utils/report.html b/mediagoblin/templates/mediagoblin/utils/report.html
new file mode 100644
index 00000000..4108cd82
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/utils/report.html
@@ -0,0 +1,33 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#}
+
+{% block report_content -%}
+ <p>
+ <a
+ {% if not request.user -%}
+ href="{{ request.urlgen('mediagoblin.auth.login') }}"
+ {% else %}
+ href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_media',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ {% endif %}
+ class="button_action" id="button_reportmedia" title="Report media">
+ {% trans %}Report media{% endtrans %}
+ </a>
+ </p>
+{% endblock %}