mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-02 10:04:22 +00:00
Use a single form for new posts and replies
This commit is contained in:
parent
df875381d4
commit
39c57a6b65
7 changed files with 42 additions and 34 deletions
16
templates/postform.tmpl
Normal file
16
templates/postform.tmpl
Normal file
|
@ -0,0 +1,16 @@
|
|||
<form class="post-form" action="/post" method="POST" enctype="multipart/form-data">
|
||||
{{if .}}
|
||||
<input type="hidden" name="reply_to_id" value="{{.InReplyToID}}" />
|
||||
<label for="post-content"> Reply to {{.InReplyToName}} </label>
|
||||
{{else}}
|
||||
<label for="post-content"> New post </label>
|
||||
{{end}}
|
||||
<div class="post-form-content-container">
|
||||
<textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{if .}}{{.ReplyContent}}{{end}}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
Attachments <input id="post-file-picker" type="file" name="attachments" multiple>
|
||||
</div>
|
||||
<button type="submit"> Post </button>
|
||||
</form>
|
||||
|
|
@ -3,21 +3,11 @@
|
|||
<div class="page-title"> Thread </div>
|
||||
|
||||
{{range .Statuses}}
|
||||
{{template "status.tmpl" .}}
|
||||
|
||||
{{if eq .ID $.ReplyToID}}
|
||||
<form class="timeline-post-form" action="/post" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="reply_to_id" value="{{$.ReplyToID}}" />
|
||||
<label for="post-content"> reply to {{.Account.DisplayName}} </label>
|
||||
<div class="post-form-content-container">
|
||||
<textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{$.ReplyContent}}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
Attachments <input id="post-file-picker" type="file" name="attachments" multiple>
|
||||
</div>
|
||||
<button type="submit"> Post </button>
|
||||
</form>
|
||||
{{end}}
|
||||
{{template "status.tmpl" .}}
|
||||
{{if $.ReplyContext}}{{if eq .ID $.ReplyContext.InReplyToID}}
|
||||
{{template "postform.tmpl" $.ReplyContext}}
|
||||
{{end}}{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -2,16 +2,8 @@
|
|||
{{template "navigation.tmpl" .NavbarData}}
|
||||
<div class="page-title"> Timeline </div>
|
||||
|
||||
<form class="timeline-post-form" action="/post" method="POST" enctype="multipart/form-data">
|
||||
<label for="post-content"> New Post </label>
|
||||
<div class="post-content-container">
|
||||
<textarea id="post-content" name="content" class="post-content" cols="50" rows="5"></textarea>
|
||||
</div>
|
||||
<div class="post-attachment-div">
|
||||
Attachments <input id="post-file-picker" type="file" name="attachments" multiple>
|
||||
</div>
|
||||
<button type="submit"> Post </button>
|
||||
</form>
|
||||
|
||||
{{template "postform.tmpl" }}
|
||||
|
||||
{{range .Statuses}}
|
||||
{{template "status.tmpl" .}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue