2023-03-01 04:47:18 +00:00
|
|
|
<form method="POST">
|
|
|
|
<input type="hidden" name="action" value="create"/>
|
|
|
|
<p>
|
2023-03-03 05:51:53 +00:00
|
|
|
<label for="uses">Number of Uses (Leave at 0 for unlimited)</label>
|
2023-03-04 06:02:24 +00:00
|
|
|
<input id="uses" type="number" name="uses" placeholder="0" min="0"/>
|
2023-03-01 04:47:18 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<label for="expiration">Expiration (Leave blank for no expiration)</label>
|
2023-03-03 05:51:53 +00:00
|
|
|
<input id="expiration" type="date" name="expiration"/>
|
2023-03-01 04:47:18 +00:00
|
|
|
</p>
|
|
|
|
<button type="submit">Create Invite</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{{ if .invites }}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Code</td>
|
|
|
|
<td>Number of Uses</td>
|
|
|
|
<td>Expiration</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ range .invites }}
|
|
|
|
<tr>
|
2023-03-04 06:02:24 +00:00
|
|
|
<td>
|
|
|
|
{{ if .Valid -}}
|
|
|
|
<a href="/invite/{{ .Code }}">{{ .Code }}</a>
|
|
|
|
{{- else -}}
|
|
|
|
<code>{{ .Code }}</code>
|
|
|
|
{{- end }}
|
|
|
|
</td>
|
|
|
|
<td>{{ .Uses }} / {{ .TotalString }}</td>
|
|
|
|
<td>{{ .ExpirationString }}</td>
|
|
|
|
<td>
|
|
|
|
<form method="POST">
|
|
|
|
<input type="hidden" name="action" value="delete"/>
|
|
|
|
<input type="hidden" name="id" value="{{.ID}}"/>
|
|
|
|
<button type="submit">Delete</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
2023-03-01 04:47:18 +00:00
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{ end }}
|