forked from retoor/devplacepy
Add the trust and safety subsystem and the App Store compliance work
Implements the moderation and consent obligations a social platform carries, so the web version and any client that speaks to it enforce the same rules. Moderation core (services/moderation/, database/moderation.py): a reportable target registry, the content filter and its choke points, the report queue with atomic resolution, enforcement actions, consent tracking, maturity gating, and account deletion with a grace window. Surfaces: POST /reports plus the member report list, /admin/moderation and the per-report admin view, /workspaces, terms acceptance at /auth/terms, consent and account deletion under /profile, the report button and dialog partials, the maturity gate, and the moderation stylesheet and ReportDialog client. Every user-generated surface stays reportable by construction: new content tables are registered in REPORTABLE_TARGETS or listed in UNREPORTABLE_TABLES with a reason, and the registry test fails the suite on anything left unclassified. Docs: community guidelines, content moderation, intellectual property, privacy, terms, contact, and the admin-only moderation operations page, plus the moderation API group and the Devii moderation actions. Compliance record: applecomp.md is the requirement register, applechanges.md the gap analysis against this codebase, and appleimpl.md the implementation design they resolve to. Tests cover the report flow, admin moderation, consent, account deletion, terms acceptance, workspaces, and the registry invariant across the unit, api, and e2e tiers.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/projects.css') }}">
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/gists.css') }}">
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/awards.css') }}">
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/moderation.css') }}">
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="profile-layout">
|
||||
@@ -93,6 +94,7 @@
|
||||
{% if can_give_award %}
|
||||
<button type="button" class="btn btn-primary btn-sm full-width" data-award-give data-username="{{ profile_user['username'] }}" data-modal="award-give-modal"{{ guest_disabled(user) }}><span class="icon">🏆</span>Give Award</button>
|
||||
{% endif %}
|
||||
{% set _type = "user" %}{% set _uid = profile_user['uid'] %}{% set _owner = profile_user['uid'] %}{% set _owner_name = "" %}{% set _class = "btn btn-secondary btn-sm full-width" %}{% include "_report_button.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -558,6 +560,7 @@
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=following#profile-tabs" class="profile-tab {% if current_tab == 'following' %}active{% endif %}" data-menu-icon="👤" data-menu-label="Following ({{ following_count }})"><span class="icon">👤</span> Following ({{ following_count }})</a>
|
||||
{% if is_owner or viewer_is_admin %}
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=notifications#profile-tabs" class="profile-tab {% if current_tab == 'notifications' %}active{% endif %}" data-menu-icon="🔔" data-menu-label="Notifications"><span class="icon">🔔</span> Notifications</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=privacy#profile-tabs" class="profile-tab {% if current_tab == 'privacy' %}active{% endif %}" data-menu-icon="🔒" data-menu-label="Privacy"><span class="icon">🔒</span> Privacy</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<button type="button" class="profile-tab overflow-tabs-more" aria-haspopup="menu" aria-label="More tabs" hidden><span class="icon">⋯</span> More</button>
|
||||
@@ -663,6 +666,69 @@
|
||||
{% if follow_pagination.has_next %}<a class="btn btn-ghost btn-sm" href="/profile/{{ profile_user['username'] }}?tab={{ current_tab }}&page={{ follow_pagination.next_page }}">Next</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% elif current_tab == 'privacy' %}
|
||||
{% if is_owner or viewer_is_admin %}
|
||||
<div class="profile-panel privacy-panel" data-consent-panel data-username="{{ profile_user['username'] }}">
|
||||
<h3>Acceptances</h3>
|
||||
<p class="privacy-intro">Accepted terms version <strong>{{ terms_version or 'none' }}</strong>{% if terms_accepted_at %} on {{ local_dt(terms_accepted_at) }}{% endif %}. The version in force is <strong>{{ current_terms_version }}</strong>. Read the <a href="/docs/terms.html">Terms of Service</a>, the <a href="/docs/community-guidelines.html">Community Guidelines</a> and the <a href="/docs/privacy.html">Privacy Policy</a>.</p>
|
||||
{% if age_band %}<p class="privacy-intro">Age band on file: <strong>{{ age_band }}</strong>. Your date of birth is not stored.</p>{% endif %}
|
||||
{% if suspension_reason %}<p class="privacy-suspension">Account restriction: {{ suspension_reason }}{% if suspended_until %} (until {{ local_dt(suspended_until) }}){% endif %}.</p>{% endif %}
|
||||
|
||||
<h3>Consents</h3>
|
||||
<table class="notif-prefs-table">
|
||||
<caption class="sr-only">Consents you have granted or withdrawn</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Consent</th>
|
||||
<th>State</th>
|
||||
<th class="notif-prefs-col">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for consent in consents %}
|
||||
<tr>
|
||||
<td>
|
||||
<span class="notif-prefs-label">{{ consent.label }}</span>
|
||||
{% if consent.version %}<span class="notif-prefs-desc">Version {{ consent.version }}</span>{% endif %}
|
||||
</td>
|
||||
<td><span class="status-badge status-{{ 'actioned' if consent.state == 'granted' else 'dismissed' }}">{{ consent.state }}</span></td>
|
||||
<td class="notif-prefs-col">
|
||||
{% if is_owner %}
|
||||
<form method="POST" action="/profile/{{ profile_user['username'] }}/consent" class="inline-form">
|
||||
<input type="hidden" name="kind" value="{{ consent.kind }}">
|
||||
<input type="hidden" name="granted" value="{{ '0' if consent.state == 'granted' else '1' }}">
|
||||
<button type="submit" class="btn btn-secondary btn-sm">{{ 'Withdraw' if consent.state == 'granted' else 'Grant' }}</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<span class="notif-prefs-desc">Only the account holder can change this.</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Mature content</h3>
|
||||
<p class="privacy-intro">Content labelled mature is hidden behind an interstitial unless you opt in. Accounts in a minor age band are never offered the reveal for restricted content.</p>
|
||||
{% if is_owner %}
|
||||
<form method="POST" action="/profile/{{ profile_user['username'] }}/mature-content" class="inline-form">
|
||||
<input type="hidden" name="mature_opt_in" value="{{ '0' if mature_opt_in else '1' }}">
|
||||
<button type="submit" class="btn btn-secondary btn-sm">{{ 'Hide mature content' if mature_opt_in else 'Show mature content' }}</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p class="privacy-intro">Only the account holder can change this preference.</p>
|
||||
{% endif %}
|
||||
|
||||
{% if is_owner %}
|
||||
<h3>Your reports</h3>
|
||||
<p class="privacy-intro">Every report you filed, and its outcome, is listed at <a href="/reports/mine">your reports</a>.</p>
|
||||
|
||||
<h3>Delete your account</h3>
|
||||
<p class="privacy-intro">Deleting removes your account and your personal data. It is reversible for {{ deletion_grace_hours }} hours, then permanently purged.</p>
|
||||
<a href="/profile/{{ profile_user['username'] }}/delete" class="btn btn-secondary btn-sm">Delete account</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% elif current_tab == 'notifications' %}
|
||||
{% if is_owner or viewer_is_admin %}
|
||||
<div class="notif-prefs profile-panel" data-notif-prefs data-username="{{ profile_user['username'] }}">
|
||||
|
||||
Reference in New Issue
Block a user