ff2dfd9130e94699c80b3cd2554d4b770bad19e3
[bloat] / templates / postform.tmpl
1 {{with .Data}}
2 <form class="post-form" action="/post" method="POST" enctype="multipart/form-data">
3         <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
4         {{if .ReplyContext}}
5         <input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" />
6         <label for="post-content" class="post-form-title"> Reply to {{.ReplyContext.InReplyToName}} </label>
7         {{else}}
8         <label for="post-content" class="post-form-title"> New post </label>
9         {{end}}
10         <a class="post-form-emoji-link" href="/emojis" target="_blank" title="emoji reference">
11                 <img class="icon post-emoji" src="{{GetIcon "smile-o" $.Ctx.DarkMode}}" alt="emojis" />
12         </a>
13         <div class="post-form-content-container">
14                 <textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{if .ReplyContext}}{{.ReplyContext.ReplyContent}}{{end}}</textarea>
15         </div>
16         <div>
17                 {{if gt (len .Formats) 0}}
18                 <span class="post-form-field">
19                         <label for="post-format"> Format </label>
20                         <select id="post-format" name="format">
21                                 {{range .Formats}} <option value="{{.Type}}">{{.Name}}</option> {{end}}
22                         </select>
23                 </span>
24                 {{end}}
25                 <span class="post-form-field">
26                         <label for="post-visilibity"> Scope </label>
27                         <select id="post-visilibity" name="visibility">
28                                 <option value="public" {{if eq .DefaultVisibility "public"}}selected{{end}}>Public</option>
29                                 <option value="unlisted" {{if eq .DefaultVisibility "unlisted"}}selected{{end}}>Unlisted</option>
30                                 <option value="private" {{if eq .DefaultVisibility "private"}}selected{{end}}>Private</option>
31                                 <option value="direct" {{if eq .DefaultVisibility "direct"}}selected{{end}}>Direct</option>
32                         </select>
33                 </span>
34                 <span class="post-form-field">
35                         <input type="checkbox" id="nsfw-checkbox" name="is_nsfw" value="on">
36                         <label for="nsfw-checkbox"> Is NSFW </label>
37                 </span>
38         </div>
39         <div>
40                 <span class="post-form-field">
41                         <label for ="post-file-picker"> Attachments </label>
42                         <input id="post-file-picker" type="file" name="attachments" multiple>
43                 </span>
44         </div>
45         <button type="submit"> Post </button>
46 </form>
47 {{end}}
48