<div class="outline">
{{ if not .Post }}
<form action="/savepost" method="POST" enctype="multipart/form-data">
<input type="hidden" name="CSRF" value="{{ .SaveCSRF }}">
<input type="hidden" name="group" value="{{ .Group.Name }}">
Create a new post.
<p><label for=link>link:</label><br><input tabindex=1 type="text" name="link" autocomplete=off>
<p><label for=title>title:</label><br><input tabindex=1 type="text" name="title" autocomplete=off>
<p><label for=content>content:</label><br>
<textarea class="large" tabindex=1 name="content"></textarea>
<p><label for=tags>tags:</label><br><input tabindex=1 type="text" name="tags" autocomplete=off>
<p>
<label tabindex=1 class=button id="attacher">attach: <input type="file" name="attachment"><span>{{ .SavedFile }}</span></label>
<p><label for=attachdesc>description:</label><br>
<input tabindex=1 type="text" name="attachdesc" value="" autocomplete=off>
<p><button tabindex=1>create</button>
<button tabindex=1 name="preview" value="preview">preview</button>
</form>
{{ else }}
{{ if .Post.CanEdit .UserInfo }}
<form action="/savepost" method="POST" enctype="multipart/form-data">
<input type="hidden" name="CSRF" value="{{ .SaveCSRF }}">
{{ if .Post.Xid }}
<input type="hidden" name="update" value="1">
<input type="hidden" name="postxid" value="{{ .Post.Xid }}">
{{ else }}
<input type="hidden" name="group" value="{{ .Post.GroupName }}">
{{ end }}
Edit post:
<p><label for=link>link:</label><br><input tabindex=1 type="text" name="link" value="{{ .Post.Link }}" autocomplete=off>
<p><label for=title>title:</label><br><input tabindex=1 type="text" name="title" value="{{ .Post.Title }}" autocomplete=off>
<p><label for=content>content:</label><br>
<textarea class="large" tabindex=1 name="content">{{ .Post.Content }}</textarea>
<p><label for=tags>tags:</label><br><input tabindex=1 type="text" name="tags" value="{{ range .Post.Tags }}{{ . }} {{ end }}" autocomplete=off>
{{ range .Post.Attachments }}
<input type="hidden" name="attachxid" value="{{ .Xid }}">
<p><label for=attachdesc>image description:</label><br>
<input tabindex=1 type="text" name="attachdesc" value="{{ .Desc }}" autocomplete=off>
{{ end }}
<p><button tabindex=1>update</button>
<button tabindex=1 name="preview" value="preview">preview</button>
</form>
{{ else }}
<p>{{ .Post.Title }}
<p>{{ .Post.Link }}
{{ end }}
<form action="/savepost" method="POST" enctype="multipart/form-data">
<input type="hidden" name="CSRF" value="{{ .SaveCSRF }}">
<input type="hidden" name="delete" value="1">
<input type="hidden" name="postxid" value="{{ .Post.Xid }}">
<p><label for=confirm>confirm:</label><br><input tabindex=1 type="text" name="confirm" autocomplete=off>
<p><button tabindex=1>delete</button>
</form>
{{ end }}
</div>
