06/16 Phase 6

This commit is contained in:
2026-06-16 13:29:32 -04:00
parent 2e9025fe55
commit 479afde2fa
16 changed files with 527 additions and 8 deletions
+53
View File
@@ -0,0 +1,53 @@
{% extends "base.html" %}
{% block title %}{{ _('Admin · Listings') }}{% endblock %}
{% block content %}
{% include "admin/_nav.html" %}
<div class="card">
<h2>{{ _('Moderation settings') }}</h2>
<form method="post" action="{{ url_for('admin.listings_settings') }}" class="settings-panel">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="field">
<label>{{ _('Auto-flag threshold (distinct reports)') }}</label>
<input class="input" type="number" name="flag_threshold" value="{{ flag_threshold }}" min="1">
</div>
<div class="field">
<label>{{ _('Keyword blocklist (one per line)') }}</label>
<textarea class="input" name="keyword_blocklist">{{ keyword_blocklist|join('\n') }}</textarea>
</div>
<button class="btn" type="submit">{{ _('Save settings') }}</button>
</form>
<h2>{{ _('Flag queue') }}</h2>
{% if not pagination.items %}<p class="muted">{{ _('No flagged listings.') }}</p>{% endif %}
<table class="list">
{% for l in pagination.items %}
<tr>
<td><a href="{{ url_for('listings.detail', listing_id=l.id) }}">{{ l.title }}</a></td>
<td>{{ l.flag_count }} {{ _('flags') }}</td>
<td><span class="badge {{ 'warn' if l.status.value == 'flagged' else 'ok' }}">{{ l.status.value }}</span></td>
<td class="muted small">{{ l.created_at.strftime('%Y-%m-%d') }}</td>
<td>
<form method="post" action="{{ url_for('admin.approve_listing', listing_id=l.id) }}" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn tiny" type="submit">{{ _('Approve') }}</button>
</form>
<form method="post" action="{{ url_for('admin.hide_listing', listing_id=l.id) }}" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn ghost tiny" type="submit">{{ _('Hide') }}</button>
</form>
<form method="post" action="{{ url_for('admin.remove_listing', listing_id=l.id) }}" style="display:inline"
onsubmit="return confirm('{{ _('Remove this listing?') }}');">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button class="btn danger tiny" type="submit">{{ _('Remove') }}</button>
</form>
</td>
</tr>
{% endfor %}
</table>
<div class="pager">
{% if pagination.has_prev %}<a href="{{ url_for('admin.listings', **merge_query(page=pagination.prev_num)) }}">&larr; {{ _('Prev') }}</a>{% endif %}
{% if pagination.has_next %}<a href="{{ url_for('admin.listings', **merge_query(page=pagination.next_num)) }}">{{ _('Next') }} &rarr;</a>{% endif %}
</div>
</div>
{% endblock %}