Files
website/templates/index.html
2025-03-24 19:17:39 +00:00

30 lines
664 B
HTML

{{ define "index" }}
<a href="/new">+ Add New Draw</a>
{{ if . }}
<table>
<tr>
<th>Date</th>
<th>Numbers</th>
<th>Spend (£)</th>
<th>Return (£)</th>
<th>Profit/Loss (£)</th>
</tr>
{{ range . }}
<tr>
<td>{{ .Date }}</td>
<td>{{ .Numbers }}</td>
<td>{{ printf "%.2f" .Spend }}</td>
<td>{{ printf "%.2f" .Return }}</td>
<td>{{ printf "%.2f" .ProfitLoss }}</td>
</tr>
{{ else }}
<tr><td colspan="5">No draws recorded yet.</td></tr>
{{ end }}
</table>
{{ else }}
<p>No draws recorded yet. <a href="/new">Add your first draw</a></p>
{{ end }}
{{ end }}