Files
vps_web/templates/forum/post_form.html
ddrwode 4210e0d70a 哈哈
2026-02-10 17:54:22 +08:00

96 lines
6.6 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' if lang == 'zh' else 'en' }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex,follow">
<title>{{ l('发布帖子', 'Topic Editor') }} - {{ l('云价眼', 'VPS Price') }}</title>
<link rel="icon" type="image/svg+xml" href="{{ url_for('static', filename='img/site-logo-mark.svg') }}">
<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 l('创建新主题', 'Create Topic') %}
{% set p_submit = submit_text if submit_text is defined and submit_text else l('发布主题', 'Publish') %}
{% 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">
<img src="{{ url_for('static', filename='img/site-logo-mark.svg') }}" alt="{{ l('云价眼 Logo', 'VPS Price Logo') }}">
<span>{{ l('云价眼论坛', 'VPS Price Forum') }}</span>
</a>
<nav class="forum-primary-nav">
<a href="{{ url_for('forum_index') }}" class="{{ 'active' if p_mode == 'create' else '' }}">{{ l('最新', 'Latest') }}</a>
<a href="{{ url_for('index') }}">{{ l('价格表', 'Pricing') }}</a>
</nav>
</div>
<div class="forum-header-right">
<span class="lang-switch">
<a href="{{ lang_url('zh') }}" class="{{ 'active' if lang == 'zh' else '' }}" title="切换到中文">中文</a>
<span class="lang-sep">|</span>
<a href="{{ lang_url('en') }}" class="{{ 'active' if lang == 'en' else '' }}" title="Switch to English">English</a>
</span>
<span class="forum-user-chip">{{ current_user.username }}</span>
<a href="{{ url_for('user_profile') }}" class="forum-link">{{ l('个人中心', 'Profile') }}</a>
<a href="{{ url_for('user_notifications') }}" class="forum-link nav-link-with-badge">{{ l('通知', 'Notifications') }}{% if notifications_unread_count %}<span class="nav-badge">{{ notifications_unread_count }}</span>{% endif %}</a>
<a href="{{ url_for('user_logout') }}" class="forum-link">{{ l('退出', 'Logout') }}</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' %}
{{ l('修改标题、分类或正文后保存,帖子会按最新活动时间排序。', 'Update title/category/content and save. The topic will be sorted by latest activity.') }}
{% else %}
{{ l('描述你的问题、评测或优惠信息,方便其他用户快速理解。', 'Describe your question, review, or deal details for other users.') }}
{% 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">{{ l('分类', '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">{{ l('标题', 'Title') }}</label>
<input id="title" name="title" type="text" required maxlength="160" value="{{ title_val or '' }}" placeholder="{{ l('例如2核4G VPS 哪家性价比高?', 'Example: Which 2C4G VPS has the best value?') }}">
</div>
<div class="form-group">
<label for="content">{{ l('正文', 'Content') }}</label>
<textarea id="content" name="content" required rows="14" placeholder="{{ l('请描述你的需求、配置、预算、地区、用途等信息。', 'Describe your needs: spec, budget, region, and usage.') }}">{{ content_val or '' }}</textarea>
<small class="form-help">{{ l('支持 Markdown代码块可用 ```language ... ```', 'Markdown supported. Use ```language ... ``` for code blocks.') }}</small>
</div>
<div class="form-actions">
<button type="submit" class="forum-btn-primary">{{ p_submit }}</button>
<a href="{{ p_cancel }}" class="forum-btn-muted">{{ l('取消', 'Cancel') }}</a>
</div>
</form>
</article>
<aside class="side-card post-helper">
<h3>{{ l('发帖建议', 'Posting Tips') }}</h3>
<ul class="helper-list">
<li>{{ l('标题尽量包含配置、预算和地区关键词。', 'Put spec, budget, and region keywords in the title.') }}</li>
<li>{{ l('正文建议写明:用途、目标线路、可接受价格。', 'In content, include usage, target route, and acceptable price.') }}</li>
<li>{{ l('若有实测数据,可附上延迟、带宽或稳定性说明。', 'If you have real test data, add latency/bandwidth/stability notes.') }}</li>
<li>{{ l('避免发布无关广告或重复内容。', 'Avoid unrelated ads or duplicate content.') }}</li>
</ul>
</aside>
</section>
</main>
</body>
</html>