]
# Give each user the appopriate privileges depending whether they are an
- # admin, an active user or an inactivated user ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ # admin, an active user or an inactive user ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for admin_user in admin_users_ids:
admin_user_id = admin_user['id']
- for privilege_id in [admin_privilege_id, uploader_privilege_id, reporter_privilege_id, commenter_privilege_id, active_privilege_id]:
+ for privilege_id in [admin_privilege_id, uploader_privilege_id,
+ reporter_privilege_id, commenter_privilege_id,
+ active_privilege_id]:
db.execute(user_privilege_assoc.insert().values(
core__privilege_id=admin_user_id,
core__user_id=privilege_id))
for active_user in active_users_ids:
active_user_id = active_user['id']
- for privilege_id in [uploader_privilege_id, reporter_privilege_id, commenter_privilege_id, active_privilege_id]:
+ for privilege_id in [uploader_privilege_id, reporter_privilege_id,
+ commenter_privilege_id, active_privilege_id]:
db.execute(user_privilege_assoc.insert().values(
core__privilege_id=active_user_id,
core__user_id=privilege_id))
for inactive_user in inactive_users_ids:
inactive_user_id = inactive_user['id']
- for privilege_id in [uploader_privilege_id, reporter_privilege_id, commenter_privilege_id]:
+ for privilege_id in [uploader_privilege_id, reporter_privilege_id,
+ commenter_privilege_id]:
db.execute(user_privilege_assoc.insert().values(
core__privilege_id=inactive_user_id,
core__user_id=privilege_id))
db.commit()
new_user_table.rename("core__users")
else:
- # If the db is not SQLite, this process is much simpler ~~~~~~~~~~~~~~~
+ # If the db is not run using SQLite, this process is much simpler ~~~~~
status = user_table.columns['status']
email_verified = user_table.columns['email_verified']
<h1>{% trans %}You have been banned{% endtrans %}
{% if expiration_date %}
- {% trans %}until{% endtrans %} {{ expiration_date }}
+ {% trans until_when=expiration_date %}until {{ until_when }}{% endtrans %}
{% else %}
{% trans %}indefinitely{% endtrans %}
{% endif %}
{% block mediagoblin_header_title %}{% endblock %}
<div class="header_right">
{%- if request.user %}
- {% if request.user and request.user.has_privilege('active') and not request.user.is_banned() %}
+ {% 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 %}
{%- 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>
+ <script src="{{ request.staticdirect('/js/setup_report_forms.js') }}">
+ </script>
{% endblock %}
{%- block mediagoblin_content %}
{% if not report %}
- Sorry, no such report found.
+ {% trans %}Sorry, no such report found.{% endtrans %}
{% else %}
<a href="{{ request.urlgen('mediagoblin.moderation.reports') }}"
class="return_to_panel button_action"
{{ 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 />
+ {% 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="{% trans %}Resolve{% endtrans %}" 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"/>
+ <input type=submit id="submit_this_report" value="{% trans %}Resolve This Report{% endtrans %}"/>
</form>
<script>
$(document).ready(function() {
<p>{{ report.result }}</p>
</pre>
{% else %}
- <input type=button disabled=disabled value="Resolve This Report"/>
- <p>You cannot take action against an administrator</p>
+ <input type=button disabled=disabled value="{% trans %}Resolve This Report{% endtrans %}"/>
+ <p>
+ {% trans %}
+ You cannot take action against an administrator
+ {% endtrans %}
+ </p>
{% endif %}
{% endif %}
{% endblock %}
{% if report.discriminator == "comment_report" %}
<td>
<img
- src="{{ request.staticdirect('/images/icon_clipboard_alert.png') }}"
+ 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(
{% elif report.discriminator == "media_report" %}
<td>
<img
- src="{{ request.staticdirect('/images/icon_clipboard_alert.png') }}"
+ 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(
{% endblock %}
{%- block mediagoblin_head %}
- <script src="{{ request.staticdirect('/js/setup_report_forms.js') }}"></script>
+ <script src="{{ request.staticdirect('/js/setup_report_forms.js') }}">
+ </script>
{% endblock %}
{% block mediagoblin_content -%}
<h1>
{%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
{% if user_banned and user_banned.expiration_date %}
- — BANNED until {{ user_banned.expiration_date }}
+ — {% trans expiration_date=user_banned.expiration_date %}
+ BANNED until {{ expiration_date }}
+ {% endtrans %}
{% elif user_banned %}
- — Banned Indefinitely
+ — {% trans %}Banned Indefinitely{% endtrans %}
{% endif %}
</h1>
{% if not user.url and not user.bio %}
</div>
{% endif %}
{% if user %}
- <h2>{%- trans %}Active Reports on {% endtrans -%}{{ user.username }}</h2>
+ <h2>
+ {%- trans username=user.username %}
+ Active Reports on {{ username }}
+ {% endtrans -%}
+ </h2>
{% if reports.count() %}
<table class="admin_side_panel">
<tr>
<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 }}
+ {%- trans report_number=report.id %}
+ Report #{{ report_number }}
+ {% endtrans -%}
</a>
</td>
<td>
<tr><td></td><td></td>
</table>
{% else %}
- {%- trans %}No active reports filed on {% endtrans -%} {{ user.username }}
+ {%- trans
+ username=user.username %}No active reports filed on {{ username }}
+ {% endtrans -%}
{% endif %}
<span class="right_align">
<a href="{{ request.urlgen(
<a href="{{ request.urlgen(
'mediagoblin.moderation.reports') }}?reporter={{user.id}}">
{%- trans
- username=user.username %}All reports that {{ username }} has filed{% endtrans %}</a>
+ username=user.username %}All reports that {{ username }} has filed
+ {% endtrans %}</a>
</span>
<span class=clear></span>
<h2>{{ user.username }}'s Privileges</h2>
<td>{{ privilege.privilege_name }}</td>
{% if privilege in user.all_privileges %}
<td class="user_with_privilege">
- Yes{% else %}
+ {% trans %}Yes{% endtrans %}{% else %}
<td class="user_without_privilege">
- No{% endif %}
+ {% trans %}No{% endtrans %}{% endif %}
</td>
{% if request.user.has_privilege('admin') %}
<td>