Files
DoGaMa-serv/internal/web/templates/catalog.html
T
codex 39a33556d6
CI / validate (pull_request) Successful in 26m0s
chore(code): improve source readability
2026-08-15 23:09:59 +02:00

114 lines
3.5 KiB
HTML

{{define "catalog.html"}}
<!doctype html>
<html lang="{{.Language}}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>
{{.Title}}
· DoGaMa
</title>
<link rel="stylesheet" href="/static/app.v2.css">
<link rel="stylesheet" href="/static/theme.v2.css">
</head>
<body class="app-body">
{{template "sidebar" .}}
<main class="app-main">
<header class="page-heading catalog-header">
<div>
<p class="eyebrow">
{{.Msg "catalog.eyebrow"}}
</p>
<h1>
{{.Msg "catalog.heading"}}
</h1>
</div>
<div class="catalog-tools">
<label class="instance-search">
<span class="sr-only">
{{.Msg "catalog.search"}}
</span>
<input id="catalog-search" type="search" placeholder="{{.Msg "catalog.search_placeholder"}}" autocomplete="off">
<kbd>
/
</kbd>
</label>
{{if and .IsAdmin .CatalogScanner}}
<form method="post" action="/catalog/scan">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<button class="scan-button" type="submit">
↻
{{.Msg "catalog.scan"}}
</button>
</form>
{{end}}
</div>
</header>
{{if .CatalogScan}}
<section class="catalog-scan-result">
<strong>
{{.CatalogScan.Found}}
{{.Msg "catalog.found"}}
·
{{len .CatalogScan.Valid}}
{{.Msg "catalog.valid"}}
·
{{len .CatalogScan.Errors}}
{{.Msg "catalog.invalid"}}
</strong>
{{if .CatalogScan.Errors}}
<ul>
{{range .CatalogScan.Errors}}
<li>
<strong>
{{.Template}}
</strong>
—
{{.Message}}
</li>
{{end}}
</ul>
{{end}}
</section>
{{end}}
{{if .Catalog}}
<section class="catalog-grid" aria-label="{{.Msg "catalog.heading"}}">
{{range .Catalog}}
<a class="catalog-card" data-catalog-card data-search="{{.GameName}} {{.ID}} {{.Description}}" href="/catalog/{{.ID}}">
<div class="catalog-cover">
<img src="{{.Image}}" alt="{{.GameName}}" loading="lazy">
<span class="cover-fallback">
◈
</span>
</div>
<h2>
{{.GameName}}
</h2>
</a>
{{end}}
</section>
<p class="search-empty" data-catalog-search-empty hidden>
{{.Msg "catalog.no_match"}}
</p>
{{else}}
<section class="empty-state">
<span class="empty-icon">
◈
</span>
<h2>
{{.Msg "catalog.empty"}}
</h2>
{{if .IsAdmin}}
<p>
{{.Msg "catalog.empty_admin"}}
</p>
{{end}}
</section>
{{end}}
</main>
<script src="/static/app.v2.js">
</script>
</body>
</html>
{{end}}