bloat/templates/postform.tmpl

75 lines
3.7 KiB
Cheetah

{{with .Data}}
<form class="post-form" action="/post" method="POST" enctype="multipart/form-data" target="_self">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}">
{{if .ReplyContext}}
<input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
<input type="hidden" name="quickreply" value="{{.ReplyContext.QuickReply}}" />
<label for="post-content" class="post-form-title"> Reply to @{{.ReplyContext.InReplyToName}} </label>
{{else}}
<label for="post-content" class="post-form-title"> New post </label>
{{end}}
<a class="post-form-emoji-link" href="/emojis" target="_blank" title="Emoji list (L)" accesskey="L">
emoji list
</a>
<div class="post-form-content-container">
<input id="post-title" name="title" class="post-title" size="34" title="Add post title" value="{{if .ReplyContext}}{{.ReplyContext.ReplySpoiler}}{{end}}" />
<textarea id="post-content" name="content" class="post-content" cols="34" rows="5" accesskey="E" title="Edit post (E)">{{if .ReplyContext}}{{.ReplyContext.ReplyContent}}{{end}}</textarea>
</div>
<div>
{{if .Formats}}
<span class="post-form-field">
{{$defFormat := .DefaultFormat}}
<select id="post-format" name="format" accesskey="F" title="Format (F)">
{{range .Formats}}
<option value="{{.Type}}" {{if eq $defFormat .Type}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
</span>
{{end}}
<span class="post-form-field">
<select id="post-visilibity" name="visibility" accesskey="S" title="Scope (S)">
<option value="public" {{if eq .DefaultVisibility "public"}}selected{{end}}>Public</option>
<option value="unlisted" {{if eq .DefaultVisibility "unlisted"}}selected{{end}}>Unlisted</option>
<option value="private" {{if eq .DefaultVisibility "private"}}selected{{end}}>Private</option>
<option value="direct" {{if eq .DefaultVisibility "direct"}}selected{{end}}>Direct</option>
</select>
</span>
<span class="post-form-field">
<input type="checkbox" id="nsfw-checkbox" name="is_nsfw" value="true" accesskey="N" title="NSFW (N)">
<label for="nsfw-checkbox"> NSFW </label>
</span>
</div>
<div>
<span class="post-form-field">
<input id="post-file-picker" type="file" name="attachments" multiple accesskey="A" title="Attachments (A)">
<details><summary> Descriptions for media attachments </summary>
{{GenerateMediaDescrForm | Raw}}
</details>
</span>
</div>
<button type="submit" accesskey="P" title="Post (P)"> Post </button>
<button type="reset" title="Reset"> Reset </button>
<input id="edit-status-id" name="edit-status-id" placeholder="Input Status ID for edit" title="Edit ID">
<input id="lang-code" name="lang-code" placeholder="lang" title="Post language (ISO 639) [en, ru, etc..] Default: none" size="4" value="{{if .ReplyContext}}{{.ReplyContext.ReplyLanguage}}{{end}}">
<input type="number" id="expires-in" name="expires-in" title="Post autodeleted after hour(s)" min="0" value="0" size="4">
<input type="datetime-local" id="scheduled" name="scheduled" step=300 title="Schedule your status (timezone UTC+0)">
<details><summary>Poll</summary>
<div>
<input type="number" id="poll-expires-in" name="poll-expires-in" min="1" value="300">
<label for="poll-expires-in"> Expires in (secs) </label>
</div>
<div>
<input type="checkbox" id="poll-hide-totals" name="poll-hide-totals" value="true">
<label for="poll-hide-totals"> Hide vote counts? </label>
</div>
<div>
<input type="checkbox" id="poll-is-multiple" name="poll-is-multiple" value="true">
<label for="poll-is_multiple "> Allow multiple choice? </label>
</div>
<div>{{GeneratePollOptions | Raw}}</div>
</details>
</form>
{{end}}