feat: 增添个人举报与申诉查询
This commit is contained in:
@@ -60,8 +60,9 @@
|
||||
你好, {{ current_user.username }}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
|
||||
<!-- <li><a class="dropdown-item" href="#">我的资料</a></li>
|
||||
<li><hr class="dropdown-divider"></li> -->
|
||||
<li><a class="dropdown-item" href="{{ url_for('main.my_reports') }}">我的举报</a></li>
|
||||
<li><a class="dropdown-item" href="{{ url_for('main.my_appeals') }}">我的申诉</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">退出登录</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
73
app/templates/my_appeals.html
Normal file
73
app/templates/my_appeals.html
Normal file
@@ -0,0 +1,73 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}我的申诉{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 class="mb-4">我的申诉记录</h2>
|
||||
|
||||
{% if appeals.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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for appeal in appeals.items %}
|
||||
<tr>
|
||||
<td>#{{ appeal.id }}</td>
|
||||
<td>{{ appeal.blacklist_entry.pt_site if appeal.blacklist_entry else '已删除' }}</td>
|
||||
<td>
|
||||
<span class="badge
|
||||
{% if appeal.status in ['approved', 'rejected'] %} bg-secondary
|
||||
{% elif 'user' in appeal.status %} bg-warning text-dark
|
||||
{% else %} bg-info text-dark {% endif %}">
|
||||
{{ appeal.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ appeal.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
||||
<td>{{ appeal.updated_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('main.appeal_detail', appeal_id=appeal.id) }}" class="btn btn-sm btn-outline-primary">查看详情</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
{% if appeals.pages > 1 %}
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
<li class="page-item {% if not appeals.has_prev %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('main.my_appeals', page=appeals.prev_num) if appeals.has_prev else '#' }}">上一页</a>
|
||||
</li>
|
||||
{% for p in appeals.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
|
||||
{% if p %}
|
||||
<li class="page-item {% if p == appeals.page %}active{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('main.my_appeals', 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 appeals.has_next %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('main.my_appeals', page=appeals.next_num) if appeals.has_next else '#' }}">下一页</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<p class="mb-0">您还没有提交过任何申诉。</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
77
app/templates/my_reports.html
Normal file
77
app/templates/my_reports.html
Normal file
@@ -0,0 +1,77 @@
|
||||
{% 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 }}</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 }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ report.created_at.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 %}
|
||||
Reference in New Issue
Block a user