feat: align with upstream — pin posts, edit marker, custom CSS, UX fixes

- Pin/unpin posts (PUT /api/posts/:id/pin, admin) with notification to author
- is_pinned/pinned_at in schema; 📌 badge on feed + detail; admin pin button
- Edited marker (已编辑) on feed + detail; edit button + modal for authors
- Custom CSS: upload/delete API + admin tab + global loader (style.css override)
- Fix: duplicate post title on detail page (remove card title, keep header)
- Fix: forum name flicker on load (localStorage cache before fetch)
- Fix: dropdown menu closes on outside click (document listener)
- Fix: document.title + <title> sync on forum rename
This commit is contained in:
lezi-fun committed 2026-08-10 12:32:06 +08:00
1 parent 7ce81969ac
commit 4ee38f6486
14 files changed
+371 -10

No files matched your search

+6
View File
@@ -78,6 +78,9 @@ export default function Feed({ onOpenModal, onReport }) {
return (
<div key={p.id} className="post-card" style={{ cursor: 'pointer' }}
onClick={() => openPost(p.id)}>
{p.is_pinned && (
<div style={{ fontSize: 12, color: 'var(--primary)', fontWeight: 600, marginBottom: 4 }}>📌 置顶</div>
)}
<div className="post-header">
<img src={avatar(p.username)} className="post-avatar" alt="" />
<span
@@ -88,6 +91,9 @@ export default function Feed({ onOpenModal, onReport }) {
{p.username || '匿名用户'}
</span>
<span className="post-time">{time}</span>
{p.edited_at && (
<span style={{ fontSize: 11, color: 'var(--text-light)', marginLeft: 6 }}>(已编辑)</span>
)}
</div>
<div className="post-title">{p.title || '无标题'}</div>
<div className="post-content">{(p.content || '').split('\n').map((l, i) => <span key={i}>{l}<br /></span>)}</div>