Seed from go-template-repo, renamed to simplexcalc
The template's files at a77fd30, without its history or LICENSE, after script/rename simplexcalc. Model: opus-5-5
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
{{define "title"}}widgets{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<h1>{{.AppName}}</h1>
|
||||
|
||||
<p>
|
||||
This page is rendered from an embedded template. The stylesheet, the
|
||||
partials in the navigation and footer, and the schema behind the
|
||||
table below all ship inside the binary.
|
||||
</p>
|
||||
|
||||
<h2>widgets ({{.WidgetCount}})</h2>
|
||||
|
||||
<form method="POST" action="/widgets">
|
||||
{{.CSRFField}}
|
||||
<label>
|
||||
name
|
||||
<input type="text" name="name" required maxlength="200" />
|
||||
</label>
|
||||
<label>
|
||||
size
|
||||
<input type="text" name="size" placeholder="4KiB" />
|
||||
</label>
|
||||
<button type="submit">create</button>
|
||||
</form>
|
||||
|
||||
{{if .Widgets}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>name</th>
|
||||
<th>size</th>
|
||||
<th>created</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Widgets}}
|
||||
<tr>
|
||||
<td>{{.Name}}</td>
|
||||
<td>{{bytes .SizeBytes}}</td>
|
||||
<td>{{since .CreatedAt}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<p class="empty">No widgets yet.</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user