diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/postform.tmpl | 16 | ||||
-rw-r--r-- | templates/thread.tmpl | 18 | ||||
-rw-r--r-- | templates/timeline.tmpl | 12 |
3 files changed, 22 insertions, 24 deletions
diff --git a/templates/postform.tmpl b/templates/postform.tmpl new file mode 100644 index 0000000..3f6eeaa --- /dev/null +++ b/templates/postform.tmpl @@ -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> + diff --git a/templates/thread.tmpl b/templates/thread.tmpl index d4c88de..9d8f650 100644 --- a/templates/thread.tmpl +++ b/templates/thread.tmpl @@ -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}} diff --git a/templates/timeline.tmpl b/templates/timeline.tmpl index fe426de..09717c1 100644 --- a/templates/timeline.tmpl +++ b/templates/timeline.tmpl @@ -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" .}} |