Get ticket functionality.

This commit is contained in:
2025-03-26 15:33:40 +00:00
parent 66abdbdd4d
commit f7b54db7c1
4 changed files with 94 additions and 17 deletions

View File

@@ -0,0 +1,53 @@
{{ define "content" }}
<a href="/account/tickets/add_ticket">+ Add Ticket</a>
<h2>My Tickets</h2>
{{ if eq (len .Tickets) 0 }}
<p>You havent logged any tickets yet.</p>
{{ else }}
<table>
<thead>
<tr>
<th>Game</th>
<th>Draw Date</th>
<th>Numbers</th>
<th>Bonus</th>
<th>Purchased</th>
<th>Via</th>
<th>Image</th>
</tr>
</thead>
<tbody>
{{ range .Tickets }}
<tr>
<td>{{ .GameType }}</td>
<td>{{ .DrawDate }}</td>
<td>
{{ .Ball1 }} {{ .Ball2 }} {{ .Ball3 }} {{ .Ball4 }} {{ .Ball5 }}
{{ if ne .Ball6 0 }} {{ .Ball6 }} {{ end }}
</td>
<td>
{{ if eq .GameType "Lotto" }}
<span style="color: lightgray; font-style: italic;"></span>
{{ else if gt (intVal .Bonus2) 0 }}
{{ if gt (intVal .Bonus1) 0 }}{{ intVal .Bonus1 }}, {{ end }}
{{ intVal .Bonus2 }}
{{ else if gt (intVal .Bonus1) 0 }}
{{ intVal .Bonus1 }}
{{ else }}
<span style="color: lightgray;"></span>
{{ end }}
</td>
<td>{{ .PurchaseDate }}</td>
<td>{{ .PurchaseMethod }}</td>
<td>
{{ if .ImagePath }}
<a href="/{{ .ImagePath }}" target="_blank">View</a>
{{ else }}{{ end }}
</td>
</tr>
{{ end }}
</tbody>
</table>
{{ end }}
{{ end }}