{{define "uploadinfo" -}}
<div class="file-info">
	File: <a href="{{.post.UploadPath}}" target="_blank">{{$.post.Filename}}</a> - ({{formatFilesize $.post.Filesize}}{{if and (gt $.post.UploadHeight 0) (gt $.post.UploadWidth 0)}}, {{$.post.UploadWidth}}x{{$.post.UploadHeight}}{{end}}, <a href="{{.post.UploadPath}}" class="file-orig" download="{{.post.OriginalFilename}}">{{.post.OriginalFilename}}</a>)
</div>
{{- end -}}
{{define "nameline"}}
	<input type="checkbox" id="check{{.post.ID}}" name="check{{.post.ID}}" />
	<label class="post-info" for="check{{.post.ID}}"><span class="subject">{{.post.Subject}}</span> <span class="postername">
		{{- if ne .post.Email ""}}<a href="mailto:{{.post.Email}}">{{end}}
	{{- if and (eq .post.Name "") (eq .post.Tripcode "") -}}
		{{.board.AnonymousName}}
	{{- else -}}
		{{.post.Name}}
	{{- end -}}
	{{- if ne .post.Email ""}}</a>{{end}}</span>
	{{- if ne .post.Tripcode ""}}<span class="tripcode">!{{.post.Tripcode}}</span>{{end -}}
	{{- if ne .post.Country.Flag ""}}{{template "post_flag" .post.Country}}{{end}}
	<time datetime="{{formatTimestampAttribute .post.Timestamp}}">{{formatTimestamp .post.Timestamp}}</time>
</label> <a href="{{.post.WebPath}}">No.</a> <a href="javascript:quote({{.post.ID}})" class="backlink-click">{{.post.ID}}</a>
<span class="status-icons">
	{{- if $.thread.Locked}}<img src="{{webPath `/static/lock.png`}}" class="locked-icon" alt="Thread locked" title="Thread locked">{{end -}}
	{{- if $.thread.Stickied}}<img src="{{webPath `/static/sticky.png`}}" class="sticky-icon" alt="Sticky" title="Sticky">{{end -}}
	{{- if $.thread.Cyclic}}<img src="{{webPath `/static/cyclic.png`}}" class="cyclic-icon" alt="Cyclic thread" title="Cyclic thread">{{end -}}
</span>
{{if $.is_board_page -}}
[<a href="{{.post.ThreadPath}}">View</a>]
{{end}}<br />
{{- end -}}
{{- if $.post.IsTopPost -}}
<div class="op-post post" id="op{{.post.ID}}">
{{- else -}}
<div id="replycontainer{{.post.ID}}" class="reply-container">
	<div class="reply" id="reply{{.post.ID}}">
		<a class="anchor" id="{{$.post.ID}}"></a>
{{- end -}}
{{if not $.post.IsTopPost}}{{template "nameline" .}}{{end -}}

{{- if eq $.post.Filename "deleted" -}}
	<div class="file-deleted-box" style="text-align:center;">File removed</div>
{{- else if ne $.post.Filename "" -}}
	{{- template "uploadinfo" . -}}
	<a class="upload-container" href="{{.post.UploadPath}}"><img src="{{getThumbnailWebPath .post.ID}}" alt="{{.post.UploadPath}}" width="{{.post.ThumbnailWidth}}" height="{{.post.ThumbnailHeight}}" class="upload thumb" /></a>
{{- end -}}
{{- if $.post.IsTopPost}}{{template "nameline" .}}{{end -}}
	<div class="post-text">{{.post.Message}}</div>
	</div>{{if not $.post.IsTopPost}}
{{if not $.post.IsTopPost}}</div>{{end}}{{end}}
