47 lines
1.3 KiB
Cheetah
47 lines
1.3 KiB
Cheetah
<form method="POST">
|
|
<input type="hidden" name="action" value="create"/>
|
|
<p>
|
|
<label for="uses">Number of Uses (Leave at 0 for unlimited)</label>
|
|
<input id="uses" type="number" name="uses" placeholder="0" min="0"/>
|
|
</p>
|
|
<p>
|
|
<label for="expiration">Expiration (Leave blank for no expiration)</label>
|
|
<input id="expiration" type="date" name="expiration"/>
|
|
</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>
|
|
<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>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
{{ end }} |