<!DOCTYPE html>
<html>
<head>
	<title>{{$board.Title}}</title>
	<script type="text/javascript" src="/javascript/jquery/jquery-1.7.2.min.js"></script>
	
	<script type="text/javascript" src="/javascript/msgpack.js"></script>
	<script type="text/javascript">
		var styles = [{{range $ii, $style := $config.Styles_img}}{{if gt $ii  0}}, {{end}}"{{$style}}"{{end}}];
		var webroot = "{{$config.SiteWebfolder}}";
		var thread_type = "board";
	</script>
	<script type="text/javascript" src="/javascript/gochan.js"></script>
	<script type="text/javascript" src="/javascript/manage.js"></script>
	<link rel="stylesheet" href="/css/global/img.css" />
{{range $i, $style := $config.Styles_img}}
	<link rel="{{if isStyleNotDefault_img $style}}alternate {{end}}stylesheet" href="/css/{{$style}}/img.css" />{{end}}
</head>
<body>
	<div id="topbar">
		{{range $i, $board := $board_arr.Data}}
			<div class="topbar-item"><a href="/{{$board.Dir}}/" style="display: block; height:100%; width:100%">/{{$board.Dir}}/</a></div>
{{end}}
	</div>
	<div id="top-pane">
		<span id="board-title">{{$board.Title}}</span><br />
		<span id="board-subtitle">{{$board.Subtitle}}</span>
	</div>
	<hr />
	<div id="right-sidelinks">
		<a href="{{$config.SiteWebfolder}}{{$board.Dir}}/catalog.html">Board catalog</a><br />
	</div>

	<div id="postbox-area">
		
		<form name="postform" action="/post" method="POST" enctype="multipart/form-data">
			<input type="hidden" name="threadid" value="0" />
			<input type="hidden" name="boardid" value="{{$board.ID}}" />
			<table id="postbox-static">
				<tr><td class="postblock">Name</td><td><input type="text" id="postname" name="postname" maxlength="75" size="28" {{/* value="Name" onFocus="if(this.value=='Name') {this,value= ''}" onBlur="if(this.value == '') {this.value = 'Name'}"*/}}/></td></tr>
				<tr><td class="postblock">Email</td><td><input type="text" id="postemail" name="postemail" maxlength="75" size="28" /></td></tr>
				<tr><td class="postblock">Subject</td><td><input type="text" name="postsubject" maxlength="75" size="35" /><input type="submit" value="Post"/></td></tr>
				<tr><td class="postblock">Message</td><td><textarea rows="4" cols="48" name="postmsg"></textarea></td></tr>
				<tr><td class="postblock">File</td><td><input name="imagefile" type="file"><input type="checkbox" id="spoiler" name="spoiler"/><label for="spoiler">Spoiler</label></td></tr>
				<tr><td class="postblock">Password</td><td><input type="password" id="postpassword" name="postpassword" size="14" /> (for post/file deletion)</td></tr>
			</table>
		</form>
		
	</div>
	<hr />
	<div id="content">
		<form action="/util" method="POST" id="main-form">
			{{range $t, $thread := $thread_arr.Data}}
				{{$op := $thread.OP}}
				<div class="op-post" id="op{{$op.ID}}">
					<input type="checkbox" id="check{{$op.ID}}" name="check{{$op.ID}}" /><label class="post-info" for="check{{$op.ID}}"> <span class="subject">{{$op.Subject}}</span> <span class="postername">{{if stringNeq $op.Email ""}}<a href="mailto:{{$op.Email}}">{{end}}{{if stringEq $op.Name ""}}{{$board.Anonymous}}{{else}}{{$op.Name}}{{end}}{{if stringNeq $op.Email ""}}</a>{{end}}</span>{{if stringNeq $op.Tripcode ""}}<span class="tripcode">!{{$op.Tripcode}}</span>{{end}} {{formatTimestamp $op.Timestamp}} </label><a href="/{{$board.Dir}}/res/{{$op.ID}}.html#{{$op.ID}}">No.</a> <a href="/{{$board.Dir}}/res/{{$op.ID}}.html#i{{$op.ID}}">{{$op.ID}}</a> <span class="post-links"> <span class="thread-ddown">[<a href="javascript:void(0)">&#9660;</a>]</span></span><br />
					{{if stringNeq $op.Filename ""}}
						{{if stringNeq $op.Filename "deleted"}}
							<span class="file-info">File: <a href="../src/{{$op.Filename}}">{{$op.Filename}}</a> - ({{formatFilesize $op.Filesize}} , {{$op.ImageW}}x{{$op.ImageH}}, {{$op.FilenameOriginal}} )</span><br />
							<a href="{{$config.SiteWebfolder}}{{$board.Dir}}/src/{{$op.Filename}}" target="_blank"><img src="{{$config.SiteWebfolder}}{{$board.Dir}}/thumb/{{imageToThumbnailPath $op.Filename}}" width="{{$op.ThumbW}}" height="{{$op.ThumbH}}" class="thumbnail" alt="{{imageToThumbnailPath $op.Filename}}" /></a>
						{{else}}
							<div class="file-deleted-box" style="text-align:center;">File removed</div>
						{{end}}
					{{end}}
					<div class="post-text">
						{{$op.Message}}
						{{if gt $thread.NumReplies 3}}
							<br /><br /><b>{{subtract $thread.NumReplies 3}} post{{if gt $thread.NumReplies 4}}s{{end}} omitted</b>
						{{end}}
					</div>
				</div>
				{{range $reply_num,$reply := $thread.BoardReplies}}
					<div class="reply" id="reply{{$reply.ID}}">
						<input type="checkbox" id="check{{$reply.ID}}" name="check{{$reply.ID}}" /> <label class="post-info" for="check{{$reply.ID}}"><span class="postername">{{if stringNeq $reply.Email ""}}<a href="mailto:{{$reply.Email}}">{{end}}{{if stringEq $reply.Name ""}}{{$board.Anonymous}}{{else}}{{$reply.Name}}{{end}}{{if stringNeq $reply.Email ""}}</a>{{end}}</span>{{if stringNeq $reply.Tripcode ""}}<span class="tripcode">!{{$reply.Tripcode}}</span>{{end}} {{formatTimestamp $reply.Timestamp}} </label><a href="135693079632">No.</a> <a href="{{$reply.ID}}i">{{$reply.ID}}</a> <span class="post-links"><span class="thread-ddown">[<a href="javascript:void(0)">&#9660;</a>]</span></span><br />
						{{if stringNeq $reply.Filename ""}}<span class="file-info">File: <a href="../src/{{$reply.Filename}}">{{$reply.Filename}}</a> - ({{formatFilesize $reply.Filesize}} , {{$reply.ImageW}}x{{$reply.ImageH}}, {{$reply.FilenameOriginal}} )</span><br />
						<a href="{{$config.SiteWebfolder}}{{$board.Dir}}/src/{{$reply.Filename}}" target="_blank"><img src="{{$config.SiteWebfolder}}{{$board.Dir}}/thumb/{{imageToThumbnailPath $reply.Filename}}" width="{{$reply.ThumbW}}" height="{{$reply.ThumbH}}" class="thumbnail" alt="{{imageToThumbnailPath $reply.Filename}}" /></a>{{end}}

						<div class="post-text">
							{{$reply.Message}}
						</div>
					</div>
					
				{{end}}
			</div>
				<hr />
			{{end}}

			<div id="left-bottom-content">
				<span id="boardmenu-bottom">
					[{{range $i, $board := $board_arr.Data}}  {{if gt $i 0}}/{{end}} <a href="/{{$board.Dir}}/">{{$board.Dir}}</a> {{end}}]
				</span>
			</div>

			<div id="right-bottom-content">
				<div id="report-delbox">
						<input type="hidden" name="board" value="{{$board.Dir}}" />
						<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 />
						Reason: <input type="text" size="10" name="reason" id="reason" /> <input type="submit" value="Report" />
				</div>
			</div>
		</form>
	</div>
	<div id="footer">
		<a href="{{$config.SiteWebfolder}}">Home</a> | <a href="{{$config.SiteWebfolder}}#boards">Boards</a> | <a href="{{$config.SiteWebfolder}}#rules">Rules</a> | <a href="{{$config.SiteWebfolder}}#faq">FAQ</a><br />
		Powered by Gochan {{$config.Version}}<br />
	</div>
</body>
</html>