{{/* 共享片段:所有后台页面通用的顶部导航与翻页器。 由 templates.go 在启动时与 layout.html 一起解析进「基模板」,各页面模板只需 {{template "bar" .}} / {{template "pager" .Pager}} 引用,改一处即全局生效 —— 这也是把导航从 14 份复制粘贴里提出来、补全模块入口的原因。 页面需要提供的数据: .NavKey 由 renderPage 自动注入(= 当前页面名),用于导航高亮 .PendingReviews 由 backstageNavStats 中间件注入(待审总数,导航角标) barLabel/barRight 两个 define 由各页面模板自己提供(见 pages/*.html) */}} {{define "bar"}}
{{template "barLabel" .}}
{{end}} {{define "pager"}}
{{if .HasPrev}}上一页{{else}}上一页{{end}} {{if .Label}}{{.Label}}{{end}} {{if .HasNext}}下一页{{else}}下一页{{end}}
{{end}} {{/* 共享片段:街拍 / 走秀编辑页共用的「图片管理」块(网格 + 合并为一组 + 拆出)。 两个后台编辑页之前各写一份几乎相同的图片管理 HTML,现已抽到这里,改一处全局生效。 页面需要提供的字段: .Kind "street" | "runway"(决定封面/删除路由前缀与主/副图文案) .UID 记录的 hashid(用于 /admin/{street-snaps|runways}//... 路由) .RecordID 记录数字 id(用于 /admin/articles///... 路由) .Status 记录状态(pending 时显示待审角标) .Cells []gin.H,每项 {id, image, name, isDetail, role} */}} {{define "imageGrid"}}

图片管理({{len .Cells}} 张{{if eq .Status "pending"}} · 待审核{{end}}{{if .DupCount}} · 重复率 {{printf "%.0f" .DupPct}}%({{.DupCount}} 张){{end}})

操作:勾选属于同一个人的图片 → 在其中一张上点「主图」→ 点底部「合并选中为一组」。副图上的「拆出」可恢复为独立主图。
{{if eq .Kind "runway"}}走秀图按 Look 分组:同一 Look 的主图 + 其细节图(副图)。{{end}}
{{$kind := .Kind}}{{$uid := .UID}}{{$rid := .RecordID}}{{$dupSources := .DupSources}}
{{range .Cells}}
{{.role}} {{.name}} {{if eq .isDuplicate 1}}重复 {{with index $dupSources .dupOf}}{{if .srcTitle}}
查看重复来源
源图缩略图
属于:{{.srcTitle}}{{if .srcBrand}} · {{.srcBrand}}{{end}}
打开所属{{if eq .srcKind "runway"}}走秀{{else}}街拍{{end}} →
{{end}}{{end}} {{end}}
{{if eq $kind "runway"}}
{{else}}
{{end}} {{if eq .isDetail 0}}{{end}} {{if and (eq .isDetail 0) .DetCount}}{{end}} {{if eq .isDetail 1}}
{{end}}
{{end}}
勾选同一人的图,并在其中一张主图上点「主图」
{{end}}