Files
vps_web/templates/forum/post_form.html
ddrwode d29515598d 哈哈
2026-02-10 11:49:01 +08:00

85 lines
4.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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">
{% set category_options = categories if categories is defined and categories else forum_categories if forum_categories is defined and forum_categories else ['综合讨论', 'VPS 评测', '优惠活动', '运维经验', '新手提问'] %}
{% set p_title = page_title if page_title is defined and page_title else '创建新主题' %}
{% set p_submit = submit_text if submit_text is defined and submit_text else '发布主题' %}
{% set p_action = action_url if action_url is defined and action_url else url_for('forum_post_new') %}
{% set p_cancel = cancel_url if cancel_url is defined and cancel_url else url_for('forum_index') %}
{% set p_mode = form_mode if form_mode is defined else 'create' %}
<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') }}" class="{{ 'active' if p_mode == 'create' else '' }}">最新</a>
<a href="{{ url_for('index') }}">价格表</a>
</nav>
</div>
<div class="forum-header-right">
<span class="forum-user-chip">{{ current_user.username }}</span>
<a href="{{ url_for('user_profile') }}" class="forum-link">个人中心</a>
<a href="{{ url_for('user_notifications') }}" class="forum-link nav-link-with-badge">通知{% if notifications_unread_count %}<span class="nav-badge">{{ notifications_unread_count }}</span>{% endif %}</a>
<a href="{{ url_for('user_logout') }}" class="forum-link">退出</a>
</div>
</div>
</header>
<main class="forum-shell">
<section class="post-editor-layout">
<article class="topic-post-card post-editor">
<h1>{{ p_title }}</h1>
<p class="editor-subtitle">
{% if p_mode == 'edit' %}
修改标题、分类或正文后保存,帖子会按最新活动时间排序。
{% else %}
描述你的问题、评测或优惠信息,方便其他用户快速理解。
{% endif %}
</p>
{% if error %}
<p class="form-error">{{ error }}</p>
{% endif %}
<form method="post" action="{{ p_action }}" class="post-form">
<div class="form-group">
<label for="category">分类</label>
<select id="category" name="category" required>
{% for c in category_options %}
<option value="{{ c }}" {{ 'selected' if c == category_val else '' }}>{{ c }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="title">标题</label>
<input id="title" name="title" type="text" required maxlength="160" value="{{ title_val or '' }}" placeholder="例如2核4G VPS 哪家性价比高?">
</div>
<div class="form-group">
<label for="content">正文</label>
<textarea id="content" name="content" required rows="14" placeholder="请描述你的需求、配置、预算、地区、用途等信息。">{{ content_val or '' }}</textarea>
</div>
<div class="form-actions">
<button type="submit" class="forum-btn-primary">{{ p_submit }}</button>
<a href="{{ p_cancel }}" class="forum-btn-muted">取消</a>
</div>
</form>
</article>
<aside class="side-card post-helper">
<h3>发帖建议</h3>
<ul class="helper-list">
<li>标题尽量包含配置、预算和地区关键词。</li>
<li>正文建议写明:用途、目标线路、可接受价格。</li>
<li>若有实测数据,可附上延迟、带宽或稳定性说明。</li>
<li>避免发布无关广告或重复内容。</li>
</ul>
</aside>
</section>
</main>
</body>
</html>