{{template "page_header.html" .}}
<header>
	<h1 id="board-title">/{{$.board.Dir}}/ - {{$.board.Title}}</h1>
	<div id="board-subtitle">
		{{$.board.Subtitle}}<br/>
		<a href="{{webPath .board.Dir "/catalog.html"}}">Catalog</a> | <a href="#footer">Bottom</a>
	</div>
</header><hr />
{{- template "postbox.html" . -}}<hr />
<form action="{{webPath "/util"}}" method="POST" id="main-form">
{{$global := .}}
{{- range $t, $thread := .threads}}{{$op := index $thread.Posts 0}}
	<div class="thread">
		{{- template "post.html" map "global" $global "board" $.board "post" $op "is_board_page" true "thread" $thread -}}
	{{- if gt $thread.OmittedPosts 0 -}}
		<b>{{$thread.OmittedPosts}} repl{{if gt $thread.OmittedPosts 1}}ies{{else}}y{{end}}{{if gt $thread.OmittedImages 0}} and {{$thread.OmittedImages}} upload{{if gt $thread.OmittedImages 1}}s{{end}}{{end}} omitted</b><br />
	{{- end -}}
	{{- range $r,$reply := $thread.Posts -}}
		{{if gt $r 0}}
			{{- template "post.html" map "global" $global "board" $.board "post" $reply -}}
		{{end}}
	{{- end -}}
	</div><hr />
{{- end}}
	<div id="right-bottom-content">
		<div id="report-delbox">
			<input type="hidden" name="board" value="{{.board.Dir}}" />
			<input type="hidden" name="boardid" value="{{.board.ID}}" />
			<label>[<input type="checkbox" name="fileonly"/>File only]</label> <input type="password" size="10" name="password" id="delete-password" /> <input type="submit" name="delete_btn" value="Delete" onclick="return confirm('Are you sure you want to delete these posts?')" /><br />
			Report reason: <input type="text" size="10" name="reason" id="reason" /> <input type="submit" name="report_btn" value="Report" /><br />
			<input type="submit" name="edit_btn" value="Edit post" />&nbsp;
			<input type="submit" name="move_btn" value="Move thread" />
		</div>
	</div>
</form>
<div id="left-bottom-content">
	<a href="#" onClick="window.location.reload(); return false;">Update</a>
	|
	<a href="#">Scroll to top</a><br/>
	<table id="pages">
		<tr>
			{{- with .prevPage -}}
				<td><a href="{{webPathDir "/" $.board.Dir (printf "%d.html" $.prevPage) }}">Prev</a></td>
			{{- end -}}
			<td>{{range $_,$i := makeLoop .numPages 1 -}}
				{{- if eq $.currentPage $i -}}
					[<b>{{$i}}</b>]
				{{- else -}}
					[<a href="{{boardPagePath $.board $i}}">{{$i}}</a>]
				{{- end -}}
			{{- end}}</td>
			{{- with .nextPage -}}
				<td><a href="{{webPathDir "/" $.board.Dir (printf "%d.html" $.nextPage) }}">Next</a></td>
			{{- end -}}
		</tr>
	</table>
	<span id="boardmenu-bottom">
		[<a href="{{webPathDir `/`}}">home</a>]&nbsp;
		[{{range $i, $boardlink := $.boards -}}
			{{- if gt $i 0}}/{{end}} <a href="{{$boardlink.WebPath `` `boardPage`}}/">{{$boardlink.Dir}}</a> {{end}}]
	</span>
</div>
{{- template "page_footer.html" .}}
