Got cool stuff working

This commit is contained in:
2025-03-20 08:11:41 +01:00
parent 896ac66ab0
commit 8490a8c029
12 changed files with 316 additions and 13 deletions

12
templates/errors.gohtml Normal file
View File

@@ -0,0 +1,12 @@
{{- /*gotype: main.ErrorVM*/}}
{{define "errors"}}
{{template "header" .StatusCode | statusText}}
<ul>
{{range .Errors}}
<li>{{.}}</li>
{{end}}
</ul>
{{template "footer"}}
{{end}}

4
templates/footer.gohtml Normal file
View File

@@ -0,0 +1,4 @@
{{define "footer"}}
</body>
</html>
{{end}}

14
templates/header.gohtml Normal file
View File

@@ -0,0 +1,14 @@
{{define "header"}}
<html>
<head>
<title>PC Inventory - {{.}}</title>
</head>
<body>
<h1>PC Inventory - <i>{{.}}</i></h1>
<form action="/device" method="get">
<label for="id">Device ID:</label>
<input type="text" id="id" name="id">
<button type="submit">Search</button>
</form>
<hr>
{{end}}

9
templates/index.gohtml Normal file
View File

@@ -0,0 +1,9 @@
{{- /*gotype: main.IndexVM */}}
{{define "index"}}
{{template "header" "wow"}}
Some statistics:
<ul>
<li>Database contains {{.AssetCount}} assets.</li>
</ul>
{{template "footer"}}
{{end}}