119 lines
6.6 KiB
HTML
119 lines
6.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>通知中心 - 论坛</title>
|
|
<link rel="stylesheet" href="/static/css/style.css">
|
|
<link rel="stylesheet" href="/static/css/forum.css">
|
|
</head>
|
|
<body class="forum-page">
|
|
<header class="forum-header">
|
|
<div class="forum-header-inner">
|
|
<div class="forum-header-left">
|
|
<a href="{{ url_for('forum_index') }}" class="forum-logo">VPS 论坛</a>
|
|
<nav class="forum-primary-nav">
|
|
<a href="{{ url_for('forum_index') }}">最新</a>
|
|
<a href="{{ url_for('index') }}">价格表</a>
|
|
<a href="{{ url_for('user_profile') }}">个人中心</a>
|
|
<a href="{{ url_for('user_notifications') }}" class="active nav-link-with-badge">通知{% if notifications_unread_count %}<span class="nav-badge">{{ notifications_unread_count }}</span>{% endif %}</a>
|
|
</nav>
|
|
</div>
|
|
<div class="forum-header-right">
|
|
<span class="forum-user-chip">{{ current_user.username }}</span>
|
|
<a href="{{ url_for('user_logout') }}" class="forum-link">退出</a>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="forum-shell">
|
|
<section class="profile-layout">
|
|
<div class="profile-main">
|
|
<article class="topic-post-card profile-summary">
|
|
<h1>通知中心</h1>
|
|
<p class="editor-subtitle">查看别人对你帖子/评论的互动,以及举报处理结果。</p>
|
|
<div class="profile-stat-grid">
|
|
<div><span>总通知</span><strong>{{ total_count }}</strong></div>
|
|
<div><span>未读</span><strong>{{ unread_count }}</strong></div>
|
|
<div><span>已读</span><strong>{{ read_count }}</strong></div>
|
|
<div><span>当前筛选</span><strong>{{ '未读' if active_status == 'unread' else '已读' if active_status == 'read' else '全部' }}</strong></div>
|
|
</div>
|
|
</article>
|
|
|
|
<section class="topic-post-card">
|
|
<div class="notification-topline">
|
|
<div class="forum-tabs profile-tabs">
|
|
<a href="{{ url_for('user_notifications', status='all') }}" class="{{ 'active' if active_status == 'all' else '' }}">全部</a>
|
|
<a href="{{ url_for('user_notifications', status='unread') }}" class="{{ 'active' if active_status == 'unread' else '' }}">未读</a>
|
|
<a href="{{ url_for('user_notifications', status='read') }}" class="{{ 'active' if active_status == 'read' else '' }}">已读</a>
|
|
</div>
|
|
<form method="post" action="{{ url_for('user_notifications_read_all') }}">
|
|
<button type="submit" class="forum-btn-muted">全部标记已读</button>
|
|
</form>
|
|
</div>
|
|
|
|
{% if message %}
|
|
<p class="form-success">{{ message }}</p>
|
|
{% endif %}
|
|
{% if error %}
|
|
<p class="form-error">{{ error }}</p>
|
|
{% endif %}
|
|
|
|
{% if notification_items %}
|
|
<ul class="notification-list">
|
|
{% for item in notification_items %}
|
|
{% set n = item.notification %}
|
|
<li class="notification-row {{ '' if n.is_read else 'unread' }}">
|
|
<div class="notification-body">
|
|
<div class="notification-head">
|
|
<span class="status-pill {{ 'active' if not n.is_read else 'inactive' }}">{{ '未读' if not n.is_read else '已读' }}</span>
|
|
<span class="topic-category">{{ item.type_label }}</span>
|
|
<span>{{ item.time_text }}</span>
|
|
{% if item.actor_name %}
|
|
<span>来自 {{ item.actor_name }}</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="notification-message">{{ n.message }}</div>
|
|
</div>
|
|
<div class="notification-actions">
|
|
<a href="{{ url_for('user_notification_go', notification_id=n.id) }}" class="forum-btn-primary">查看</a>
|
|
{% if not n.is_read %}
|
|
<form method="post" action="{{ url_for('user_notification_read', notification_id=n.id) }}">
|
|
<input type="hidden" name="next" value="{{ request.full_path if request.query_string else request.path }}">
|
|
<button type="submit" class="forum-btn-muted">标记已读</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<p class="topic-empty">当前没有通知。</p>
|
|
{% endif %}
|
|
</section>
|
|
</div>
|
|
|
|
<aside class="forum-sidebar">
|
|
<div class="side-card">
|
|
<h3>通知说明</h3>
|
|
<ul class="side-list">
|
|
<li><span>帖子新评论</span><strong>别人评论你的帖子</strong></li>
|
|
<li><span>主题新回复</span><strong>别人回复你参与的主题</strong></li>
|
|
<li><span>举报处理结果</span><strong>你发起的举报被处理</strong></li>
|
|
<li><span>内容处理通知</span><strong>你的内容被处理</strong></li>
|
|
</ul>
|
|
</div>
|
|
<div class="side-card">
|
|
<h3>快捷操作</h3>
|
|
<div class="form-actions">
|
|
<a href="{{ url_for('forum_post_new') }}" class="forum-btn-primary">发布主题</a>
|
|
<a href="{{ url_for('user_profile') }}" class="forum-btn-muted">返回个人中心</a>
|
|
<a href="{{ url_for('forum_index') }}" class="forum-btn-muted">返回论坛</a>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
</section>
|
|
</main>
|
|
</body>
|
|
</html>
|