Files
pt_blacklist/app/templates/my_reports.html
2025-11-28 09:08:53 +08:00

78 lines
3.0 KiB
HTML

{% extends "base.html" %}
{% block title %}我的举报{% endblock %}
{% block content %}
<h2 class="mb-4">我的举报记录</h2>
{% if reports.items %}
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-light">
<tr>
<th>ID</th>
<th>被举报站点</th>
<th>被举报邮箱</th>
<th>举报类型</th>
<th>状态</th>
<th>提交时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for report in reports.items %}
<tr>
<td>#{{ report.id }}</td>
<td>{{ report.reported_pt_site }}</td>
<td>{{ report.reported_email }}</td>
<td>{{ report.reason_category | translate_reason }}</td>
<td>
<span class="badge
{% if report.status == 'approved' %} bg-success
{% elif report.status == 'rejected' %} bg-danger
{% elif report.status == 'revoked' %} bg-warning text-dark
{% elif report.status == 'overturned' %} bg-secondary
{% else %} bg-info {% endif %}">
{{ report.status | translate_status }}
</span>
</td>
<td>{{ (report.created_at | to_beijing_time).strftime('%Y-%m-%d %H:%M') }}</td>
<td>
<a href="{{ url_for('main.report_detail', report_id=report.id) }}" class="btn btn-sm btn-outline-primary">查看详情</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- 分页 -->
{% if reports.pages > 1 %}
<nav>
<ul class="pagination justify-content-center">
<li class="page-item {% if not reports.has_prev %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('main.my_reports', page=reports.prev_num) if reports.has_prev else '#' }}">上一页</a>
</li>
{% for p in reports.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
{% if p %}
<li class="page-item {% if p == reports.page %}active{% endif %}">
<a class="page-link" href="{{ url_for('main.my_reports', page=p) }}">{{ p }}</a>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">...</span></li>
{% endif %}
{% endfor %}
<li class="page-item {% if not reports.has_next %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('main.my_reports', page=reports.next_num) if reports.has_next else '#' }}">下一页</a>
</li>
</ul>
</nav>
{% endif %}
{% else %}
<div class="alert alert-info">
<p class="mb-0">您还没有提交过任何举报。<a href="{{ url_for('main.create_report') }}">立即提交举报</a></p>
</div>
{% endif %}
{% endblock %}