fix: 英文转译
This commit is contained in:
@@ -74,8 +74,8 @@ class UpdateUserForm(FlaskForm):
|
||||
], validators=[DataRequired()])
|
||||
|
||||
status = SelectField('状态', choices=[
|
||||
('active', '激活 (Active)'),
|
||||
('disabled', '禁用 (Disabled)')
|
||||
('active', '正常'),
|
||||
('disabled', '已禁用')
|
||||
], validators=[DataRequired()])
|
||||
|
||||
submit = SubmitField('更新')
|
||||
|
||||
@@ -113,10 +113,15 @@ def report_list():
|
||||
return render_template('admin/report_list.html', reports=reports_pagination)
|
||||
@main.route('/report/<int:report_id>', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@permission_required('admin', 'trust_user')
|
||||
def report_detail(report_id):
|
||||
"""举报详情"""
|
||||
report = Report.query.get_or_404(report_id)
|
||||
|
||||
# 权限检查:管理员、信任用户、或举报提交者本人可以查看
|
||||
if current_user.role not in ['admin', 'trust_user'] and report.reporter_id != current_user.id:
|
||||
flash('您无权查看此举报。', 'warning')
|
||||
return redirect(url_for('main.index'))
|
||||
|
||||
if current_user.role == 'trust_user' and report.status != 'pending':
|
||||
flash('您无权查看已处理的举报。', 'warning')
|
||||
return redirect(url_for('main.report_list'))
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if current_user.role == 'admin' %}
|
||||
{% if current_user.role in ['admin', 'trust_user'] %}
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header"><h5 class="mb-0">管理员操作</h5></div>
|
||||
<div class="card-header"><h5 class="mb-0">{% if current_user.role == 'admin' %}管理员操作{% else %}信任用户操作{% endif %}</h5></div>
|
||||
<div class="card-body d-grid gap-2">
|
||||
{% if current_user.role == 'admin' %}
|
||||
{% if report.status == 'pending' or report.status == 'in_review' %}
|
||||
<form action="{{ url_for('main.process_report', report_id=report.id) }}" method="POST" class="d-grid">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
@@ -56,11 +57,14 @@
|
||||
{% else %}
|
||||
<p class="text-muted mb-0">该举报已处理完毕,无更多操作。</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p class="text-muted mb-0">您可以在下方添加审核建议。</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if related_reports %}
|
||||
{% if current_user.role in ['admin'] and related_reports %}
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header"><h5 class="mb-0">相关举报 (同一邮箱)</h5></div>
|
||||
<div class="list-group list-group-flush">
|
||||
@@ -79,6 +83,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 右侧评论区 -->
|
||||
{% if current_user.role in ['admin', 'trust_user'] %}
|
||||
<div class="col-lg-7">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header"><h5 class="mb-0">审核与讨论</h5></div>
|
||||
@@ -115,6 +120,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- 撤销操作的 Modal -->
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<li class="list-group-item"><strong>邮箱:</strong> {{ entry.email }}</li>
|
||||
<li class="list-group-item"><strong>站点:</strong> {{ entry.pt_site }}</li>
|
||||
{% if entry.report %}
|
||||
<li class="list-group-item"><strong>违规原因:</strong> {{ entry.report.reason_category }}</li>
|
||||
<li class="list-group-item"><strong>违规原因:</strong> {{ entry.report.reason_category | translate_reason }}</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<td>#{{ report.id }}</td>
|
||||
<td>{{ report.reported_pt_site }}</td>
|
||||
<td>{{ report.reported_email }}</td>
|
||||
<td>{{ report.reason_category }}</td>
|
||||
<td>{{ report.reason_category | translate_reason }}</td>
|
||||
<td>
|
||||
<span class="badge
|
||||
{% if report.status == 'approved' %} bg-success
|
||||
|
||||
Reference in New Issue
Block a user