@ -1,37 +1,37 @@
{{define "title"}}草稿审核 · 管理后台{{end}}
{{define "barLabel"}}管理后台 · 草稿审核 #{{.Draft .ID}}{{end}}
{{define "barRight"}}< a href = "{{reviewDetailURL .Draft .Kind .Draft .ID}}" > 返回列表< / a > · < a href = "/admin/logout" > 退出< / a > {{end}}
{{define "barLabel"}}管理后台 · 草稿审核 #{{.Record .ID}}{{end}}
{{define "barRight"}}< a href = "{{reviewDetailURL .Record .Kind .Record .ID}}" > 返回列表< / a > · < a href = "/admin/logout" > 退出< / a > {{end}}
{{define "content"}}
{{template "bar" .}}
< div class = "main mid" >
< p class = "muted" > 类型 < b > {{.Draft .Kind}}< / b > {{if .BrandName}} · 品牌 {{.BrandName}}{{end}} · 状态 < b > {{.Draft .Status}}< / b > < / p >
< p class = "muted" > 类型 < b > {{.Record .Kind}}< / b > {{if .BrandName}} · 品牌 {{.BrandName}}{{end}} · 状态 < b > {{.Record .Status}}< / b > < / p >
{{/* 字段微调 + 通过:仍是普通表单提交(无 JS 也能用);键盘 a 会触发同一个表单 */}}
< form method = "post" action = "/admin/reviews/{{.Draft .Kind}}/{{.Draft .ID}}/approve" >
{{range .Draft .Fields}}< div > < label > {{.Label}}< / label > {{if eq .Type "textarea"}}< textarea name = "{{.Name}}" > {{.Value}}< / textarea > {{else}}< input name = "{{.Name}}" value = "{{.Value}}" { { if eq . Type " number " } } inputmode = "numeric" { { end } } > {{end}}< / div > {{end}}
< form method = "post" action = "/admin/reviews/{{.Record .Kind}}/{{.Record .ID}}/approve" >
{{range .Record .Fields}}< div > < label > {{.Label}}< / label > {{if eq .Type "textarea"}}< textarea name = "{{.Name}}" > {{.Value}}< / textarea > {{else}}< input name = "{{.Name}}" value = "{{.Value}}" { { if eq . Type " number " } } inputmode = "numeric" { { end } } > {{end}}< / div > {{end}}
< button type = "submit" > 通过并发布< / button >
< / form >
{{if eq .Draft .Kind "street"}}
{{if eq .Record .Kind "street"}}
< div class = "hint" >
操作:勾选属于同一个人的图片 → 在< b > 其中一张< / b > 上点「主图」→ 点底部「合并选中为一组」。副图上的「拆出」可恢复为独立主图。< br >
快捷键:< b > j< / b > /< b > k< / b > 上下移动 · < b > x< / b > 勾选 · < b > m< / b > 设为主图 · < b > d< / b > 拆出 · < b > Enter< / b > 看大图 · < b > a< / b > 通过
< button type = "button" class = "x" id = "hint-dismiss" aria-label = "收起提示" > ✕< / button >
< / div >
< h2 > 图片(< span id = "img-stat" > {{len .Draft .Images}} 张 · {{len .Draft .Groups}} 组< / span > ) < / h2 >
< h2 > 图片(< span id = "img-stat" > {{len .Record .Images}} 张 · {{len .Record .Groups}} 组< / span > ) < / h2 >
{{/* 合并表单本体在 grid 之前;各格的 radio/checkbox 通过 form="batch" 关联过来 */}}
< form id = "batch" method = "post" action = "/admin/reviews/{{.Draft .Kind}}/{{.Draft .ID}}/images/attach" > < / form >
< form id = "batch" method = "post" action = "/admin/reviews/{{.Record .Kind}}/{{.Record .ID}}/images/attach" > < / form >
< div class = "grid" >
{{range .Draft .Images}}< div class = "cell{{if eq .IsDetail 1}} det{{end}}" data-img-id = "{{.ID}}" >
{{range .Record .Images}}< div class = "cell{{if eq .IsDetail 1}} det{{end}}" data-img-id = "{{.ID}}" >
< button class = "thumb" type = "button" data-zoom > < img src = "{{.Image}}" loading = "lazy" > < / button >
< span class = "role" > {{if eq .IsDetail 1}}副图 → #{{.ParentImageID}}{{else}}主图{{if .DetailCount}} · {{.DetailCount}} 副图{{end}}{{end}}< / span >
< span class = "nm" > {{.Name}}< / span >
< div class = "acts" >
{{if eq .IsDetail 0}}< label class = "chk" data-only = "main" > < input type = "radio" form = "batch" name = "main" value = "{{.ID}}" > 主图< / label > {{end}}
< label class = "chk" > < input type = "checkbox" form = "batch" name = "img" value = "{{.ID}}" > 选入< / label >
{{if eq .IsDetail 1}}< form data-only = "detail" method = "post" action = "/admin/reviews/{{$.Draft .Kind}}/{{$.Draft .ID}}/images/{{.ID}}/detach" > < button type = "submit" > 拆出< / button > < / form > {{end}}
< form method = "post" action = "/admin/reviews/{{$.Draft .Kind}}/{{$.Draft .ID}}/images/{{.ID}}/delete" > < button type = "submit" class = "reject" onclick = "return confirm('确认删除这张图片?')" > 删除< / button > < / form >
{{if eq .IsDetail 1}}< form data-only = "detail" method = "post" action = "/admin/reviews/{{$.Record .Kind}}/{{$.Record .ID}}/images/{{.ID}}/detach" > < button type = "submit" > 拆出< / button > < / form > {{end}}
< form method = "post" action = "/admin/reviews/{{$.Record .Kind}}/{{$.Record .ID}}/images/{{.ID}}/delete" > < button type = "submit" class = "reject" onclick = "return confirm('确认删除这张图片?')" > 删除< / button > < / form >
< / div >
< / div > {{end}}
< / div >
@ -41,13 +41,13 @@
< span class = "muted" > 勾选同一人的图,并在其中一张主图上点「主图」< / span >
< / div >
{{else}}
< h2 > 图片管理({{len .Draft .Images}} 张)< / h2 >
< h2 > 图片管理({{len .Record .Images}} 张)< / h2 >
< div class = "grid" >
{{range .Draft .Images}}< div class = "cell" data-img-id = "{{.ID}}" >
{{range .Record .Images}}< div class = "cell" data-img-id = "{{.ID}}" >
< button class = "thumb" type = "button" data-zoom > < img src = "{{.Image}}" loading = "lazy" > < / button >
< span class = "nm" > {{.Name}}< / span >
< div class = "acts" >
< form method = "post" action = "/admin/reviews/{{$.Draft .Kind}}/{{$.Draft .ID}}/images/{{.ID}}/delete" > < button type = "submit" class = "reject" onclick = "return confirm('确认删除这张图片?')" > 删除< / button > < / form >
< form method = "post" action = "/admin/reviews/{{$.Record .Kind}}/{{$.Record .ID}}/images/{{.ID}}/delete" > < button type = "submit" class = "reject" onclick = "return confirm('确认删除这张图片?')" > 删除< / button > < / form >
< / div >
< / div > {{end}}
< / div >