47 lines
1.9 KiB
HTML
47 lines
1.9 KiB
HTML
{{define "syb/shops"}}
|
|
{{template "header" .}}
|
|
|
|
<div class="toolbar">
|
|
<form class="inline grow" method="post" action="/syb/shops/create">
|
|
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
|
<label for="shop-name">店铺名称</label>
|
|
<input id="shop-name" type="text" name="shop_name" maxlength="500" required
|
|
placeholder="与顺运宝 shopName 完全一致">
|
|
<button type="submit" class="primary">新增并启用</button>
|
|
</form>
|
|
<a class="button-link" href="/syb">返回顺运宝数据</a>
|
|
</div>
|
|
|
|
{{if .Message}}<p class="hint" role="status">{{.Message}}</p>{{end}}
|
|
{{if .Error}}<p class="missing" role="alert">{{.Error}}</p>{{end}}
|
|
<p class="hint">同步只接受启用店铺;匹配时忽略名称首尾空白,但不做模糊匹配。没有启用店铺时同步会安全停止。</p>
|
|
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead><tr><th>店铺名称</th><th>状态</th><th>更新时间</th><th>操作</th></tr></thead>
|
|
<tbody>
|
|
{{range .Rows}}
|
|
<tr>
|
|
<td title="{{.ShopName}}">{{.ShopName}}</td>
|
|
<td>{{if .Enabled}}启用{{else}}停用{{end}}</td>
|
|
<td>{{.UpdatedAt}}</td>
|
|
<td>
|
|
<form class="inline" method="post" action="/syb/shops/status">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}">
|
|
<input type="hidden" name="shop_id" value="{{.ShopID}}">
|
|
<input type="hidden" name="enabled" value="{{if .Enabled}}0{{else}}1{{end}}">
|
|
<button type="submit">{{if .Enabled}}停用{{else}}重新启用{{end}}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr class="empty"><td colspan="4">还没有同步店铺。请先新增并启用至少一个店铺,才能开始同步。</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="statusbar"><span class="grow"></span><span>共 {{len .Rows}} 个店铺,启用 {{.EnabledCount}} 个</span></div>
|
|
{{template "footer" .}}
|
|
{{end}}
|