aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-10-07 15:48:33 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-10-07 15:48:33 -0500
commit56c4ad89ebef32bd5a40c00d987811ce4501ce22 (patch)
tree7523b2b274ce512093aed3914520275c80fe7e8f /mediagoblin/templates
parent345b958871c48df56b8d1acf9516bb9780aa6701 (diff)
parent0a24db84c5769149537b0d9bd8e3a88fe8e9522a (diff)
downloadmediagoblin-56c4ad89ebef32bd5a40c00d987811ce4501ce22.tar.lz
mediagoblin-56c4ad89ebef32bd5a40c00d987811ce4501ce22.tar.xz
mediagoblin-56c4ad89ebef32bd5a40c00d987811ce4501ce22.zip
Merge remote-tracking branch 'refs/remotes/tilly-q/OPW-Moderation-Update'
Conflicts: mediagoblin/templates/mediagoblin/user_pages/user.html mediagoblin/tests/test_auth.py mediagoblin/tests/test_submission.py
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/banned.html35
-rw-r--r--mediagoblin/templates/mediagoblin/base.html36
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/media_panel.html (renamed from mediagoblin/templates/mediagoblin/admin/panel.html)5
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/report.html154
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/report_panel.html200
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/user.html204
-rw-r--r--mediagoblin/templates/mediagoblin/moderation/user_panel.html97
-rw-r--r--mediagoblin/templates/mediagoblin/terms_of_service.html291
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection.html2
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection_list.html2
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html21
-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/user_pages/user_nonactive.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/collection_gallery.html2
-rw-r--r--mediagoblin/templates/mediagoblin/utils/report.html28
16 files changed, 1147 insertions, 17 deletions
diff --git a/mediagoblin/templates/mediagoblin/banned.html b/mediagoblin/templates/mediagoblin/banned.html
new file mode 100644
index 00000000..cd54158a
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/banned.html
@@ -0,0 +1,35 @@
+{#
+# 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 %}You are Banned.{% endtrans %}{% endblock %}
+
+{% block mediagoblin_content %}
+ <img class="right_align" src="{{ request.staticdirect('/images/404.png') }}"
+ alt="{% trans %}Image of goblin stressing out{% endtrans %}" />
+
+ <h1>{% trans %}You have been banned{% endtrans %}
+ {% if expiration_date %}
+ {% trans %}until{% endtrans %} {{ expiration_date }}
+ {% else %}
+ {% trans %}indefinitely{% endtrans %}
+ {% endif %}
+ </h2>
+ <p>{{ reason|safe }}</p>
+ <div class="clear"></div>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html
index f9deb2ad..94ca7aa5 100644
--- a/mediagoblin/templates/mediagoblin/base.html
+++ b/mediagoblin/templates/mediagoblin/base.html
@@ -62,7 +62,7 @@
{% block mediagoblin_header_title %}{% endblock %}
<div class="header_right">
{%- if request.user %}
- {% if request.user and request.user.status == 'active' %}
+ {% if request.user and request.user.has_privilege('active') and not request.user.is_banned() %}
{% set notification_count = get_notification_count(request.user.id) %}
{% if notification_count %}
@@ -71,7 +71,7 @@
{% endif %}
<a href="javascript:;" class="button_action header_dropdown_down">&#9660;</a>
<a href="javascript:;" class="button_action header_dropdown_up">&#9650;</a>
- {% elif request.user and request.user.status == "needs_email_verification" %}
+ {% elif request.user and not request.user.has_privilege('active') %}
{# the following link should only appear when verification is needed #}
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
user=request.user.username) }}"
@@ -84,6 +84,19 @@
"javascript:;"
{% endif %}
>{% trans %}log out{% endtrans %}</a>
+ {% elif request.user and request.user.is_banned() %}
+ <a id="logout" href=
+ {% if persona is not defined %}
+ "{{ request.urlgen('mediagoblin.auth.logout') }}"
+ {% else %}
+ "javascript:;"
+ {% endif %}
+ >{% trans %}log out{% endtrans %}</a>
+ <p class="fine_print">
+ <a href="{{ request.urlgen('terms_of_service') }}">
+ {%- trans %}Terms of Service{%- endtrans %}
+ </a>
+ </p>
{% endif %}
{%- elif auth %}
<a href=
@@ -98,7 +111,7 @@
{%- endif %}
</div>
<div class="clear"></div>
- {% if request.user and request.user.status == 'active' %}
+ {% if request.user and request.user.has_privilege('active') %}
<div class="header_dropdown">
<p>
<span class="dropdown_title">
@@ -130,14 +143,25 @@
<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>
+ &middot;
+ <a href="{{ request.urlgen('mediagoblin.moderation.users') }}">
+ {%- trans %}User management panel{% endtrans -%}
+ </a>
+ &middot;
+ <a href="{{ request.urlgen('mediagoblin.moderation.reports') }}">
+ {%- trans %}Report management panel{% endtrans -%}
+ </a>
</p>
{% endif %}
+ <p class="fine_print">
+ <a href="{{ request.urlgen('terms_of_service') }}">Terms of Service</a>
+ </p>
{% include 'mediagoblin/fragments/header_notifications.html' %}
</div>
{% endif %}
diff --git a/mediagoblin/templates/mediagoblin/admin/panel.html b/mediagoblin/templates/mediagoblin/moderation/media_panel.html
index 1c3c866e..3c929d4f 100644
--- a/mediagoblin/templates/mediagoblin/admin/panel.html
+++ b/mediagoblin/templates/mediagoblin/moderation/media_panel.html
@@ -21,6 +21,7 @@
{% trans %}Media processing panel{% endtrans %} &mdash; {{ super() }}
{%- endblock %}
+
{% block mediagoblin_content %}
<h1>{% trans %}Media processing panel{% endtrans %}</h1>
@@ -28,7 +29,7 @@
<p>
{% trans %}Here you can track the state of media being processed on this instance.{% endtrans %}
</p>
-
+
<h2>{% trans %}Media in-processing{% endtrans %}</h2>
{% if processing_entries.count() %}
@@ -56,7 +57,7 @@
</table>
{% else %}
<p><em>{% trans %}No media in-processing{% endtrans %}</em></p>
-{% endif %}
+{% endif %}
<h2>{% trans %}These uploads failed to process:{% endtrans %}</h2>
{% if failed_entries.count() %}
diff --git a/mediagoblin/templates/mediagoblin/moderation/report.html b/mediagoblin/templates/mediagoblin/moderation/report.html
new file mode 100644
index 00000000..cb717cde
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/report.html
@@ -0,0 +1,154 @@
+{#
+# 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_head %}
+ <script src="{{ request.staticdirect('/js/setup_report_forms.js') }}"></script>
+{% endblock %}
+
+{%- 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() 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() 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.reported_user.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() {
+ init_report_resolution_form();
+ });
+ </script>
+ {% elif report.is_archived_report() %}
+ <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") }}
+ <pre>
+ <p>{{ report.result }}</p>
+ </pre>
+ {% 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..4eb16b2b
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/report_panel.html
@@ -0,0 +1,200 @@
+{#
+# 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 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() %}
+ {% if not active_settings.last_page == 1 %}
+ {% if 'active_p='~active_settings.current_page in request.query_string %}
+ {% set query_string = request.query_string %}{% else %}
+ {% set query_string =
+'active_p='~active_settings.current_page~"&"+request.query_string %}
+ {% endif %}
+ <div class="right_align">
+ {% set first_vis = active_settings.current_page-3 %}
+ {% set last_vis = active_settings.current_page+3 %}
+ {% set curr_page = active_settings.current_page %}
+ {% if 1 == curr_page %}<b>1</b>{% else %}
+ <a href ="?{{ query_string.replace(
+ 'active_p='~active_settings.current_page,
+ 'active_p='~1) }}">
+ 1</a>{% endif %}
+ {% if first_vis > 1 %}...{% endif %}
+ {% for p in range(first_vis,last_vis+1) %}
+ {% if p > 1 and p < active_settings.last_page and
+curr_page !=p %}
+ <a href="?{{ query_string.replace(
+ 'active_p='~active_settings.current_page,
+ 'active_p='~p) }}">
+ {{ p }}</a>
+ {% elif p > 1 and p < active_settings.last_page %}
+ <b>{{ p }}</b>
+ {% endif %}
+ {% endfor %}
+ {% if last_vis < active_settings.last_page %}...{% endif %}
+ {% if active_settings.last_page != curr_page %}
+ <a href ="?{{ query_string.replace(
+ 'active_p='~active_settings.current_page,
+ 'active_p='~active_settings.last_page) }}">
+ {{ active_settings.last_page }}</a>
+ {% else %}<b>{{ active_settings.last_page }}</b>
+ {% endif %}
+ </div>
+ {% endif %}
+ <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() %}
+ {% if not closed_settings.last_page == 1 %}
+ {% if 'closed_p='~closed_settings.current_page in request.query_string %}
+ {% set query_string = request.query_string %}{% else %}
+ {% set query_string =
+'closed_p='~closed_settings.current_page~"&"+request.query_string %}
+ {% endif %}
+ <div class="right_align">
+ {% set first_vis = closed_settings.current_page-3 %}
+ {% set last_vis = closed_settings.current_page+3 %}
+ {% set curr_page = closed_settings.current_page %}
+ {% if not curr_page==1 %}
+ <a href ="?{{ query_string.replace(
+ 'closed_p='~closed_settings.current_page,
+ 'closed_p='~1) }}">1</a>
+ {% else %}
+ <b>1 </b>
+ {% endif %}
+ {% if first_vis > 1 %}...{% endif %}
+ {% for p in range(first_vis,last_vis+1) %}
+ {% if p > 1 and p < closed_settings.last_page and
+curr_page !=p %}
+ <a href="?{{ query_string.replace(
+ 'closed_p='~closed_settings.current_page,
+ 'closed_p='~p) }}">
+ {{ p }}</a>
+
+ {% elif p > 1 and p < closed_settings.last_page %}
+ <b>{{ p }}</b>
+ {% endif %}
+ {% endfor %}
+ {% if last_vis < closed_settings.last_page %}...{% endif %}
+ {% if curr_page != closed_settings.last_page %}
+ <a href ="?{{ query_string.replace(
+ 'closed_p='~closed_settings.current_page,
+ 'closed_p='~closed_settings.last_page) }}">
+ {{ closed_settings.last_page }}</a>
+ {% else %}<b>{{ closed_settings.last_page }}</b>
+ {% endif %}
+ </div>
+ {% endif %}
+ <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..36ba42ac
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/user.html
@@ -0,0 +1,204 @@
+{#
+# 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 title %}
+ {%- if user -%}
+ {%- trans username=user.username -%}
+ User: {{ username }}
+ {%- endtrans %} &mdash; {{ super() }}
+ {%- else -%}
+ {{ super() }}
+ {%- endif -%}
+{% endblock %}
+
+{%- block mediagoblin_head %}
+ <script src="{{ request.staticdirect('/js/setup_report_forms.js') }}"></script>
+{% 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 not user.has_privilege('active') %}
+ <div class="profile_sidebar empty_space">
+ <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>
+
+ </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 %}
+ <span class="right_align">
+ <a href="{{ request.urlgen(
+ 'mediagoblin.moderation.reports') }}?reported_user={{user.id}}">
+ {%- trans
+ username=user.username %}All reports on {{ username }}{% endtrans %}</a>
+ &middot;
+ <a href="{{ request.urlgen(
+ 'mediagoblin.moderation.reports') }}?reporter={{user.id}}">
+ {%- trans
+ username=user.username %}All reports that {{ username }} has filed{% endtrans %}</a>
+ </span>
+ <span class=clear></span>
+ <h2>{{ user.username }}'s Privileges</h2>
+ <form method=POST action="{{ request.urlgen(
+ 'mediagoblin.moderation.ban_or_unban',
+ user=user.username) }}" class="right_align">
+ {{ csrf_token }}
+ {% if request.user.has_privilege('admin') and not user_banned and
+ not user.id == request.user.id %}
+ {{ wtforms_util.render_divs(ban_form) }}
+ <input type=submit class="button_action"
+ value="{% trans %}Ban User{% endtrans %}"
+ id="ban_user_submit" />
+ {% elif request.user.has_privilege('admin') and
+ not user.id == request.user.id %}
+ <input type=submit class="button_action right_align"
+ value="{% trans %}UnBan User{% endtrans %}" />
+ {% endif %}
+ </form>
+ <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'));
+ });
+ init_user_banned_form();
+ $('#ban_user_submit').click(function(){
+ submit_user_banned_form()
+ });
+});
+ </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..4949960e
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/moderation/user_panel.html
@@ -0,0 +1,97 @@
+{#
+# 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() %}
+ {% if not last_page == 1 %}
+ {% if 'p='~current_page in request.query_string %}
+ {% set query_string = request.query_string %}{% else %}
+ {% set query_string =
+'p='~current_page~"&"+request.query_string %}
+ {% endif %}
+ <div class="right_align">
+ {% set first_vis = current_page-3 %}
+ {% set last_vis = current_page+3 %}
+ {% if 1 == current_page %}<b>1</b>{% else %}
+ <a href ="?{{ query_string.replace(
+ 'p='~current_page,
+ 'p='~1) }}">
+ 1</a>{% endif %}
+ {% if first_vis > 1 %}...{% endif %}
+ {% for p in range(first_vis,last_vis+1) %}
+ {% if p > 1 and p < last_page and
+current_page !=p %}
+ <a href="?{{ query_string.replace(
+ 'p='~current_page,
+ 'p='~p) }}">
+ {{ p }}</a>
+ {% elif p > 1 and p < last_page %}
+ <b>{{ p }}</b>
+ {% endif %}
+ {% endfor %}
+ {% if last_vis < last_page %}...{% endif %}
+ {% if last_page != current_page %}
+ <a href ="?{{ query_string.replace(
+ 'p='~current_page,
+ 'p='~last_page) }}">
+ {{ last_page }}</a>
+ {% else %}<b>{{ last_page }}</b>
+ {% endif %}
+ </div>
+ {% endif %}
+ <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/terms_of_service.html b/mediagoblin/templates/mediagoblin/terms_of_service.html
new file mode 100644
index 00000000..a9e8ebf2
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/terms_of_service.html
@@ -0,0 +1,291 @@
+{#
+# 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 %}
+ Terms of Service
+{% endblock %}
+
+{% block mediagoblin_content -%}
+{# <h2>The gist</h2>
+# This is where you might insert your own particular rules, unique to your
+# own website. Or your own worded summary.
+#}
+
+<h2>Terms of Service</h2>
+
+The following terms and conditions govern all use of the
+{{ app_config['html_title'] }} website and all content, services and products
+available at or through the website (taken together, the Website). The Website
+is owned and operated by Status.net (“Operator”). The Website is offered
+subject to your acceptance without modification of all of the terms and
+conditions contained herein and all other operating rules, policies
+(including, without limitation, Operator’s Privacy Policy) and procedures
+that may be published from time to time on this Site by Operator (collectively,
+ the “Agreement”).
+
+Please read this Agreement carefully before accessing or using the Website.
+By accessing or using any part of the web site, you agree to become bound by
+the terms and conditions of this agreement. If you do not agree to all the
+terms and conditions of this agreement, then you may not access the Website
+or use any services. If these terms and conditions are considered an offer by
+Operator, acceptance is expressly limited to these terms. The Website is
+available only to individuals who are at least 13 years old.
+
+<ol id="code_of_conduct_list">
+ <li><strong>Your {{ app_config['html_title'] }} Account and Site.</strong>
+ If you create a notice stream on the Website, you are responsible for
+ maintaining the security of your account and notice stream, and you are
+ fully responsible for all activities that occur under the account and any
+ other actions taken in connection with the notice stream. You must not
+ describe or assign keywords to your notice stream in a misleading or
+ unlawful manner,
+ including in a manner intended to trade on the name or reputation of
+ others, and Operator may change or remove any description or keyword that
+ it considers inappropriate or unlawful, or otherwise likely to cause
+ Operator liability. You must immediately notify Operator of any
+ unauthorized uses of your notice stream, your account or any other breaches
+ of security. Operator will not be liable for any acts or omissions by You,
+ including any damages of any kind incurred as a result of such acts or
+ omissions.
+ </li>
+ <li><strong>Responsibility of Contributors.</strong> If you operate a notice
+ stream, comment on a notice stream, post material to the Website, post
+ links on the Website, or otherwise make
+ (or allow any third party to make) material
+ available by means of the Website (any such material, “Content”), You are
+ entirely responsible for the content of, and any harm resulting from, that
+ Content. That is the case regardless of whether the Content in question
+ constitutes text, graphics, an audio file, or computer software. By making
+ Content available, you represent and warrant that:
+ <ul class="nested_sublist">
+ <li>the downloading, copying and use of the Content will not infringe
+ the proprietary rights, including but not limited to the copyright,
+ patent, trademark or trade secret rights, of any third party;
+ </li>
+ <li>if your employer has rights to intellectual property you create, you
+ have either (i) received permission from your employer to post or make
+ available the Content, including but not limited to any software, or
+ (ii) secured from your employer a waiver as to all rights in or to the
+ Content;
+ </li>
+ <li>you have fully complied with any third-party licenses relating to the
+ Content, and have done all things necessary to successfully pass
+ through to end users any required terms;
+ </li>
+ <li>the Content does not contain or install any viruses, worms, malware,
+ Trojan horses or other harmful or destructive content;
+ </li>
+ <li>the Content is not spam, and does not contain unethical or unwanted
+ commercial content designed to drive traffic to third party sites or
+ boost the search engine rankings of third party sites, or to further
+ unlawful acts (such as phishing) or mislead recipients as to the
+ source of the material (such as spoofing);
+ </li>
+ <li>if the Content is machine- or randomly-generated, it is for purposes
+ of direct entertainment, information and/or utility for you or other
+ users, and not for spam,
+ </li>
+ <li>the Content is not libelous or defamatory (more info on what that
+ means), does not contain threats or incite violence towards individuals
+ or entities, and does not violate the privacy or publicity rights of
+ any third party;
+ </li>
+ <li>your notice stream is not getting advertised via unwanted electronic
+ messages such as spam links on newsgroups, email lists, other notice
+ streams and web sites, and similar unsolicited promotional methods;
+ </li>
+ <li>your notice stream is not named in a manner that misleads your
+ readers into thinking that you are another person or company. For
+ example, your notice stream’s URL or name is not the name of a person
+ other than yourself or company other than your own; and
+ </li>
+ <li>you have, in the case of Content that includes computer code,
+ accurately categorized and/or described the type, nature, uses and
+ effects of the materials, whether requested to do so by Operator or
+ otherwise.</li>
+ </ul>
+ By submitting Content to Operator for inclusion on your Website, you grant
+ Operator a world-wide, royalty-free, and non-exclusive license to
+ reproduce, modify, adapt and publish the Content solely for the purpose of
+ displaying, distributing and promoting your notice stream.
+ By submitting Content to Operator for inclusion on your Website, you grant
+ all readers the right to use, re-use, modify and/or re-distribute the
+ Content under the terms of the Creative Commons Attribution 3.0.
+ If you delete Content, Operator will use reasonable efforts to remove it
+ from the Website, but you acknowledge that caching or references to the
+ Content may not be made immediately unavailable.
+ Without limiting any of those representations or warranties, Operator has
+ the right (though not the obligation) to, in Operator’s sole discretion
+ (i) refuse or remove any content that, in Operator’s reasonable opinion,
+ violates any Operator policy or is in any way harmful or objectionable, or
+ (ii) terminate or deny access to and use of the Website to any individual
+ or entity for any reason, in Operator’s sole discretion.
+ </li>
+ <li><strong>Responsibility of Website Visitors.</strong> Operator has not
+ reviewed, and cannot
+ review, all of the material, including computer software, posted to the
+ Website, and cannot therefore be responsible for that material’s content,
+ use or effects. By operating the Website, Operator does not represent or
+ imply that it endorses the material there posted, or that it believes such
+ material to be accurate, useful or non-harmful. You are responsible for
+ taking precautions as necessary to protect yourself and your computer
+ systems from viruses, worms, Trojan horses, and other harmful or
+ destructive content. The Website may contain content that is offensive,
+ indecent, or otherwise objectionable, as well as content containing
+ technical inaccuracies, typographical mistakes, and other errors. The
+ Website may also contain material that violates the privacy or publicity
+ rights, or infringes the intellectual property and other proprietary
+ rights, of third parties, or the downloading, copying or use of which is
+ subject to additional terms and conditions, stated or unstated. Operator
+ disclaims any responsibility for any harm resulting from the use by
+ visitors of the Website, or from any downloading by those visitors of
+ content there posted.
+ </li>
+ <li><strong>Content Posted on Other Websites.</strong> We have not reviewed,
+ and cannot
+ review, all of the material, including computer software, made available
+ through the websites and webpages to which {{ app_config['html_title'] }}
+ links, and that link to {{ app_config['html_title'] }}. Operator does not
+ have any control over those external websites and webpages, and is not
+ responsible for their contents or their use. By linking to a external
+ website or webpage, Operator does not represent or imply that it endorses
+ such website or webpage. You are responsible for taking precautions as
+ necessary to protect yourself and your computer systems from viruses,
+ worms, Trojan horses, and other harmful or destructive content. Operator
+ disclaims any responsibility for any harm resulting from your use of
+ external websites and webpages.
+ </li>
+ <li><strong>Copyright Infringement and DMCA Policy.</strong> As Operator asks
+ others to
+ respect its intellectual property rights, it respects the intellectual
+ property rights of others. If you believe that material located on or
+ linked to by {{ app_config['html_title'] }} violates your copyright, you
+ are encouraged to notify Operator in accordance with Operator’s Digital
+ Millennium Copyright Act (”DMCA”) Policy. Operator will respond to all
+ such notices, including as required or appropriate by removing the
+ infringing material or disabling all links to the infringing material. In
+ the case of a visitor who may infringe or repeatedly infringes the
+ copyrights or other intellectual property rights of Operator or others,
+ Operator may, in its discretion, terminate or deny access to and use of
+ the Website. In the case of such termination, Operator will have no
+ obligation to provide a refund of any amounts previously paid to Operator.
+ </li>
+ <li><strong>Intellectual Property.</strong> This Agreement does not transfer
+ from Operator to
+ you any Operator or third party intellectual property, and all right,
+ title and interest in and to such property will remain (as between the
+ parties) solely with Operator. {{ app_config['html_title'] }}, the
+ {{ app_config['html_title'] }} logo, and all other trademarks, service
+ marks, graphics and logos used in connection with
+ {{ app_config['html_title'] }}, or the Website are trademarks or
+ registered trademarks of Operator or Operator’s licensors. Other
+ trademarks, service marks, graphics and logos used in connection with the
+ Website may be the trademarks of other third parties. Your use of the
+ Website grants you no right or license to reproduce or otherwise use any
+ Operator or third-party trademarks.
+ </li>
+ <li><strong>Changes.</strong> Operator reserves the right, at its sole
+ discretion, to modify
+ or replace any part of this Agreement. It is your responsibility to check
+ this Agreement periodically for changes. Your continued use of or access
+ to the Website following the posting of any changes to this Agreement
+ constitutes acceptance of those changes. Operator may also, in the future,
+ offer new services and/or features through the Website (including, the
+ release of new tools and resources). Such new features and/or services
+ shall be subject to the terms and conditions of this Agreement.
+ </li>
+ <li><strong>Termination.</strong> Operator may terminate your access to all
+ or any part of
+ the Website at any time, with or without cause, with or without notice,
+ effective immediately. If you wish to terminate this Agreement or your
+ {{ app_config['html_title'] }} account (if you have one), you may simply
+ discontinue using the Website. All provisions of this Agreement which by
+ their nature should survive termination shall survive termination,
+ including, without limitation, ownership provisions, warranty disclaimers,
+ indemnity and limitations of liability.
+ </li>
+ <li><strong>Disclaimer of Warranties.</strong> The Website is provided
+ “as is”. Operator and
+ its suppliers and licensors hereby disclaim all warranties of any kind,
+ express or implied, including, without limitation, the warranties of
+ merchantability, fitness for a particular purpose and non-infringement.
+ Neither Operator nor its suppliers and licensors, makes any warranty that
+ the Website will be error free or that access thereto will be continuous
+ or uninterrupted. If you’re actually reading this, here’s a treat. You
+ understand that you download from, or otherwise obtain content or services
+ through, the Website at your own discretion and risk.
+ </li>
+ <li><strong>Limitation of Liability.</strong> In no event will Operator, or
+ its suppliers or
+ licensors, be liable with respect to any subject matter of this agreement
+ under any contract, negligence, strict liability or other legal or
+ equitable theory for: (i) any special, incidental or consequential damages;
+ (ii) the cost of procurement or substitute products or services; (iii) for
+ interruption of use or loss or corruption of data; or (iv) for any amounts
+ that exceed the fees paid by you to Operator under this agreement during
+ the twelve (12) month period prior to the cause of action. Operator shall
+ have no liability for any failure or delay due to matters beyond their
+ reasonable control. The foregoing shall not apply to the extent prohibited
+ by applicable law.
+ </li>
+ <li><strong>General Representation and Warranty.</strong> You represent and
+ warrant that (i)
+ your use of the Website will be in strict accordance with the Operator
+ Privacy Policy, with this Agreement and with all applicable laws and
+ regulations (including without limitation any local laws or regulations in
+ your country, state, city, or other governmental area, regarding online
+ conduct and acceptable content, and including all applicable laws regarding
+ the transmission of technical data exported from the United States or the
+ country in which you reside) and (ii) your use of the Website will not
+ infringe or misappropriate the intellectual property rights of any third
+ party.
+ </li>
+ <li><strong>Indemnification.</strong> You agree to indemnify and hold
+ harmless Operator, its
+ contractors, and its licensors, and their respective directors, officers,
+ employees and agents from and against any and all claims and expenses,
+ including attorneys’ fees, arising out of your use of the Website,
+ including but not limited to out of your violation this Agreement.
+ </li>
+ <li><strong>Miscellaneous.</strong> This Agreement constitutes the entire
+ agreement between
+ Operator and you concerning the subject matter hereof, and they may only
+ be modified by a written amendment signed by an authorized executive of
+ Operator, or by the posting by Operator of a revised version. If any part
+ of this Agreement is held invalid or unenforceable, that part will be
+ construed to reflect the parties’ original intent, and the remaining
+ portions will remain in full force and effect. A waiver by either party of
+ any term or condition of this Agreement or any breach thereof, in any one
+ instance, will not waive such term or condition or any subsequent breach
+ thereof. You may assign your rights under this Agreement to any party that
+ consents to, and agrees to be bound by, its terms and conditions; Operator
+ may assign its rights under this Agreement without condition. This
+ Agreement will be binding upon and will inure to the benefit of the
+ parties, their successors and permitted assigns.
+ </li>
+</ol>
+
+Originally published by Automattic, Inc. as the WordPress.com Terms of Service
+and made available by them under the Creative Commons Attribution-
+ShareAlike 3.0 License. Modifications to remove reference to "VIP services",
+rename "blog" to "notice stream", remove the choice-of-venue clause, and add
+variables specific to instances of this software made by Control Yourself, Inc.
+and made available under the terms of the same license.
+
+{% 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/collection_list.html b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
index 8ac0b988..4b449c76 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
@@ -34,7 +34,7 @@
</h1>
{% if request.user %}
- {% if request.user.status == 'active' %}
+ {% if request.user.has_privilege('active') %}
<p>
<a href="{{ request.urlgen('mediagoblin.submit.collection',
user=user.username) }}">
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index 39935b40..81e5013e 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) %}
@@ -86,7 +86,7 @@
{% autoescape False %}
<p>{{ media.description_html }}</p>
{% endautoescape %}
- {% if comments %}
+ {% if comments and request.user and request.user.has_privilege('commenter') %}
{% if app_config['allow_comments'] %}
<a
{% if not request.user %}
@@ -146,6 +146,15 @@
{{ comment.content_html }}
{%- endautoescape %}
</div>
+ <div>
+ {% if app_config.allow_reporting %}
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_comment',
+ user=media.get_uploader.username,
+ media=media.slug_or_id,
+ comment=comment.id) }}">
+ {% trans %}Report{% endtrans %}</a>
+ {% endif %}
+ </div>
</li>
{% endfor %}
</ul>
@@ -156,7 +165,7 @@
<div class="media_sidebar">
<h3>{% trans %}Added{% endtrans %}</h3>
<p><span title="{{ media.created.strftime("%I:%M%p %Y-%m-%d") }}">
- {%- trans formatted_time=timesince(media.created) -%}
+ {%- trans formatted_time=timesince(media.created) -%}
{{ formatted_time }} ago
{%- endtrans -%}
</span></p>
@@ -170,6 +179,10 @@
{% include "mediagoblin/utils/collections.html" %}
+ {% if app_config.allow_reporting %}
+ {% include "mediagoblin/utils/report.html" %}
+ {% endif %}
+
{% 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..ce0fb1bc
--- /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 50ad766a..37983400 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/user.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/user.html
@@ -67,7 +67,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/user_pages/user_nonactive.html b/mediagoblin/templates/mediagoblin/user_pages/user_nonactive.html
index b3066665..d924198b 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/user_nonactive.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/user_nonactive.html
@@ -33,7 +33,7 @@
{% block mediagoblin_content -%}
{# User exists, but needs verification #}
- {% if user.status == "needs_email_verification" %}
+ {% if not user.has_privilege('active') %}
{% if user == request.user %}
{# this should only be visible when you are this user #}
<div class="form_box">
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..3829de97
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/utils/report.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/>.
+#}
+
+{% block report_content -%}
+ <p>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_media',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ class="button_action" id="button_reportmedia" title="Report media">
+ {% trans %}Report media{% endtrans %}
+ </a>
+ </p>
+{% endblock %}