99 lines
1.7 KiB
Plaintext
99 lines
1.7 KiB
Plaintext
{{- /*gotype: allowance_planner.ViewModel*/}}
|
|
<html lang="en">
|
|
<head>
|
|
<title>Allowance Planner 2000</title>
|
|
</head>
|
|
<body>
|
|
<h1>Allowance Planner 2000</h1>
|
|
<h2>Users</h2>
|
|
{{range .Users}}
|
|
{{if eq $.CurrentUser .ID}}
|
|
<strong>{{.Name}}</strong>
|
|
{{else}}
|
|
<a href="/login?user={{.ID}}">{{.Name}}</a>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{if ne .CurrentUser 0}}
|
|
<h2>Allowances</h2>
|
|
<table border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Progress</th>
|
|
<th>Target</th>
|
|
<th>Weight</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Allowances}}
|
|
{{if eq .ID 0}}
|
|
<tr>
|
|
<td>Total</td>
|
|
<td>{{.Progress}}</td>
|
|
<td></td>
|
|
<td>{{.Weight}}</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr>
|
|
<td>{{.Name}}</td>
|
|
<td>{{.Progress}}</td>
|
|
<td>{{.Target}}</td>
|
|
<td>{{.Weight}}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
|
|
<h2>Tasks</h2>
|
|
<form method="post" action="/createTask">
|
|
<table border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Assigned</th>
|
|
<th>Reward</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Tasks}}
|
|
<tr>
|
|
<td>{{.Name}}</td>
|
|
<td>{{.Assigned}}</td>
|
|
<td>{{.Reward}}</td>
|
|
</tr>
|
|
{{end}}
|
|
<tr>
|
|
<td><label><input type="text" placeholder="Name"></label></td>
|
|
<td></td>
|
|
<td>
|
|
<label><input type="number" placeholder="Reward"></label>
|
|
<button>Create</button>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
|
|
<h2>History</h2>
|
|
<table border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>Timestamp</th>
|
|
<th>Allowance</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .History}}
|
|
<tr>
|
|
<td>{{.Timestamp}}</td>
|
|
<td>{{.Allowance}}</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{end}}
|
|
</body>
|
|
</html>
|