fix: 去掉独立修订表格,消除帖子重复显示

- 移除管理后台独立的"修订待审核"表格区域
- 修订标识和按钮已在主列表中内联展示,无需额外表格
- PostsPage 不再额外查询 Revisions 列表
This commit is contained in:
2026-05-30 20:31:19 +08:00
parent 95311704fe
commit 8bb87cd685
2 changed files with 1 additions and 46 deletions

View File

@ -47,9 +47,6 @@ func (ctrl *AdminPostController) PostsPage(c *gin.Context) {
nextPage = totalPages
}
// 查询待审修订approved 帖子有 PendingBody 的)
revisions, _, _ := ctrl.postService.ListPendingRevisions(keyword, 1, 100)
c.HTML(http.StatusOK, "admin/posts/index.html", common.BuildAdminPageData(c, gin.H{
"Title": "内容管理",
"Posts": posts,
@ -61,7 +58,6 @@ func (ctrl *AdminPostController) PostsPage(c *gin.Context) {
"Keyword": keyword,
"Status": status,
"StatusNames": common.PostStatusDisplayNames,
"Revisions": revisions,
"ExtraCSS": "/admin/static/css/posts.css",
}))
}

View File

@ -22,47 +22,6 @@
<div class="error-message">{{.Error}}</div>
{{end}}
{{if .Revisions}}
<div class="revision-section">
<h2>修订待审核 <span class="revision-count">{{len .Revisions}}</span></h2>
<table class="admin-table revision-table">
<thead>
<tr>
<th>ID</th>
<th>标题</th>
<th>作者</th>
<th>状态</th>
<th>时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{{range .Revisions}}
<tr class="post-row revision-row">
<td>{{.ID}}</td>
<td><a href="/posts/{{.ID}}" target="_blank" class="post-link">{{.Title}}</a> <span class="revision-badge">修订中</span></td>
<td>{{if .AuthorName}}{{.AuthorName}}({{.UserID}}){{else}}UID{{.UserID}}{{end}}</td>
<td><span class="status-badge status-{{.Status}}">{{index $.StatusNames .Status}}</span>{{if .IsLocked}} <span class="status-badge status-locked">已锁定</span>{{end}}</td>
<td>{{.CreatedAt.Format "2006-01-02 15:04"}}</td>
<td class="actions-cell">
<div class="action-btns">
<button class="btn btn-sm btn-success post-approve" data-id="{{.ID}}">通过修订</button>
<button class="btn btn-sm btn-warning post-reject" data-id="{{.ID}}">退回修订</button>
{{if and (not .IsLocked)}}
<button class="btn btn-sm btn-danger post-lock" data-id="{{.ID}}">锁定</button>
{{end}}
{{if .IsLocked}}
<button class="btn btn-sm btn-success post-unlock" data-id="{{.ID}}">解锁</button>
{{end}}
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{end}}
<table class="admin-table">
<thead>
<tr>
@ -75,7 +34,7 @@
</tr>
</thead>
<tbody>
{{if and (eq (len .Posts) 0) (eq (len .Revisions) 0)}}
{{if eq (len .Posts) 0}}
<tr><td colspan="6" class="empty">暂无帖子</td></tr>
{{end}}
{{range .Posts}}