<h1 class="manage-header">Ban user</h1>
<form method="POST" action="/manage?action=bans">
<input type="hidden" name="do" value="add" />
<b>User filter:</b><br />
<table>
	<tr><th>IP address</th><td><input type="text" name="ip" value="{{.post.IP}}" /></td></tr>
	<tr><th></th><td>"192.168.1.36" will ban posts from that IP address<br />
		"192.168" will block all IPs starting with 192.168<br /></td></tr>
	<tr><th>Name!Tripcode</th><td><input type="text" name="name" value="{{if ne .post.Name ""}}{{.post.Name}}!{{.post.Tripcode}}{{end}}"/> <label>Regex<input type="checkbox" name="nameregex" /></label></td></tr>
	<tr><th>Ban filename</th><td><input type="text" name="filename" value="{{.post.FilenameOriginal}}"/></td></tr>
	<tr><th>Ban file checksum</th><td><input type="text" name="checksum" value="{{.post.FileChecksum}}" /></td></tr>
</table><br /><hr />

<b>Ban info</b><br />
<table>
	<tr><th>Duration</th><td><input type="text" name="duration" /></td></tr>
	<tr><th></th><td>e.g. '1y2mo3w4d5h6m7s',<br />'1 year 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds',<br /> or 'forever', '0', or '' for a permaban</td></tr>
	<tr><th>Ban type</th><td><label>Image ban <input type="checkbox" name="imageban" /></label><br />
		<label>Thread starting ban <input type="checkbox" name="threadban" /></label><br />
		<label>Full ban (overrides the above) <input type="checkbox" name="fullban" /></label></tr>
	<tr><th>Boards</th><td><input type="text" name="boards" /></td></tr>
	<tr><th></th><td>Comma-separated list of boards (e.g. board1,board2,board3) or blank for all boards</td></tr>
	<tr><th>Reason</th><td><textarea name="reason" rows="5" cols="30"></textarea></td></tr>
	<tr><th>Staff note</th><td><input type="text" name="staffnote" /></td></tr>
</table>
<input type="submit" value="Ban user" />
</form>

<h2 class="manage-header">Banlist</h2>
<table>
	<tr><th>IP</th><th>Name!Tripcode</th><th>Reason</th><th>Staff note</th><th>Boards</th><th>Staff</th><th>Set</th><th>Expires</th><th>Permaban</th></tr>
{{range $b, $ban := $.banlist}}	<tr><td>{{$ban.IP}}</td><td>{{$ban.Name}}</td><td>{{$ban.Reason}}</td><td>{{$ban.StaffNote}}</td><td>{{if eq $ban.Boards ""}}<i>all boards</i>{{else}}{{$ban.Boards}}{{end}}</td><td>{{$ban.Staff}}</td><td>{{$ban.Timestamp}}</td><td>{{if $ban.Permaban}}never{{else}}{{$ban.Expires}}{{end}}</td><td>{{$ban.Permaban}}</td></tr>
{{end}}</table>