31 lines
2.0 KiB
HTML
31 lines
2.0 KiB
HTML
{{define "title"}}品牌管理 · 管理后台{{end}}
|
|
{{define "barLabel"}}管理后台 · 品牌管理{{end}}
|
|
{{define "barRight"}}<a href="/admin/brands/new">+ 新建</a> · <a href="/admin/logout">退出</a>{{end}}
|
|
{{define "content"}}
|
|
{{template "bar" .}}
|
|
<div class="main">
|
|
<h1>品牌列表</h1>
|
|
<form class="toolbar" method="get" action="/admin/brands">
|
|
<input name="keyword" placeholder="搜索品牌名…" value="{{.Keyword}}">
|
|
{{if .All}}<input type="hidden" name="all" value="1">{{end}}
|
|
<button type="submit">搜索</button>
|
|
{{if .Keyword}}<a href="/admin/brands{{if .All}}?all=1{{end}}">清除</a>{{end}}
|
|
<span class="spacer"></span>
|
|
{{if .All}}<a class="view" href="/admin/brands?keyword={{.Keyword}}">只看有图集的品牌</a>{{else}}<a class="view" href="/admin/brands?keyword={{.Keyword}}&all=1">显示全部品牌(含无图集)</a>{{end}}
|
|
</form>
|
|
<p class="muted">默认只显示「已有图集」的品牌;品牌目录共 2 万余条,其余请用上面的搜索或开关查看。</p>
|
|
<div class="idx">
|
|
<a href="/admin/brands?keyword={{.Keyword}}{{if .All}}&all=1{{end}}" class="{{if eq .Letter ""}}on{{end}}">全部</a>
|
|
<a href="/admin/brands?letter=OTHER&keyword={{.Keyword}}{{if .All}}&all=1{{end}}" class="{{if eq .Letter "OTHER"}}on{{end}}">中文</a>
|
|
{{range $l := .Letters}}<a href="/admin/brands?letter={{$l}}&keyword={{$.Keyword}}{{if $.All}}&all=1{{end}}" class="{{if eq $l $.Letter}}on{{end}}">{{$l}}</a>{{end}}
|
|
</div>
|
|
<table>
|
|
<thead><tr><th>编码 ID</th><th>英文名</th><th>中文名</th><th>操作</th></tr></thead>
|
|
<tbody>
|
|
{{range .Items}}<tr><td><code>{{.UID}}</code></td><td>{{.NameEn}}</td><td>{{.NameCn}}</td><td><a class="view" href="/admin/brands/{{.UID}}">编辑</a><form class="inline" method="post" action="/admin/brands/{{.UID}}/delete" onsubmit="return confirm('确认删除品牌「{{.NameEn}}」?该品牌下若还有图集会拒绝删除。')"><button type="submit" class="op op-warn">删除</button></form></td></tr>{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{template "pager" .Pager}}
|
|
</div>
|
|
{{end}}
|