diff options
author | r <r@freesoftwareextremist.com> | 2019-12-21 13:26:31 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2019-12-21 13:26:31 +0000 |
commit | 2678f33157d147ba548793709cd8fbaabb4eaae2 (patch) | |
tree | 37d4775452f68dc8a52f3156758dc3475feeda68 /templates | |
parent | 3af4361927d65b896ac3f9e2f0170cbbef63c0c0 (diff) | |
download | bloat-2678f33157d147ba548793709cd8fbaabb4eaae2.tar.gz bloat-2678f33157d147ba548793709cd8fbaabb4eaae2.zip |
Add support for scopes
- Add scope selection for for new post
- Save new post scope in db
- Copy scope on reply
- Show scope icon on posts
Diffstat (limited to 'templates')
-rw-r--r-- | templates/postform.tmpl | 20 | ||||
-rw-r--r-- | templates/status.tmpl | 32 | ||||
-rw-r--r-- | templates/thread.tmpl | 4 | ||||
-rw-r--r-- | templates/timeline.tmpl | 2 |
4 files changed, 43 insertions, 15 deletions
diff --git a/templates/postform.tmpl b/templates/postform.tmpl index 3f6eeaa..137232f 100644 --- a/templates/postform.tmpl +++ b/templates/postform.tmpl @@ -1,15 +1,25 @@ <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> + {{if .ReplyContext}} + <input type="hidden" name="reply_to_id" value="{{.ReplyContext.InReplyToID}}" /> + <label for="post-content"> Reply to {{.ReplyContext.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> + <textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{if .ReplyContext}}{{.ReplyContext.ReplyContent}}{{end}}</textarea> </div> <div> - Attachments <input id="post-file-picker" type="file" name="attachments" multiple> + <label for ="post-visilibity"> Visibility </label> + <select id="post-visilibity" type="file" name="visibility"> + <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> + </div> + <div> + <label for ="post-file-picker"> Attachments </label> + <input id="post-file-picker" type="file" name="attachments" multiple> </div> <button type="submit"> Post </button> </form> diff --git a/templates/status.tmpl b/templates/status.tmpl index 0e6f0c0..a89fc78 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -26,6 +26,17 @@ <a href="/user/{{.Account.ID}}" > <span class="status-uname"> {{.Account.Acct}} </span> </a> + <a class="status-visibility" href="{{.URL}}" target="_blank"> + {{if eq .Visibility "public"}} + <span class="icon dripicons-web" title="Public"></span> + {{else if eq .Visibility "unlisted"}} + <span class="icon dripicons-lock-open" title="Unlisted"></span> + {{else if eq .Visibility "private"}} + <span class="icon dripicons-lock" title="Private"></span> + {{else if eq .Visibility "direct"}} + <span class="icon dripicons-mail" title="Direct"></span> + {{end}} + </a> </div> {{end}} <div class="status-reply-container"> @@ -68,16 +79,23 @@ <span class="icon dripicons-reply"></span> <span> {{DisplayInteractionCount .RepliesCount}} </span> </a> - {{if .Reblogged}} - <a class="status-retweet" href="/unretweet/{{.ID}}" title="undo repost"> - <span class="icon dripicons-retweet retweeted"></span> - <span> {{DisplayInteractionCount .ReblogsCount}} </span> - </a> - {{else}} - <a class="status-retweet" href="/retweet/{{.ID}}" title="repost"> + {{if or (eq .Visibility "private") (eq .Visibility "direct")}} + <a class="status-retweet" title="this status cannot be retweeted"> <span class="icon dripicons-retweet"></span> <span> {{DisplayInteractionCount .ReblogsCount}} </span> </a> + {{else}} + {{if .Reblogged}} + <a class="status-retweet" href="/unretweet/{{.ID}}" title="undo retweet"> + <span class="icon dripicons-retweet retweeted"></span> + <span> {{DisplayInteractionCount .ReblogsCount}} </span> + </a> + {{else}} + <a class="status-retweet" href="/retweet/{{.ID}}" title="retweet"> + <span class="icon dripicons-retweet"></span> + <span> {{DisplayInteractionCount .ReblogsCount}} </span> + </a> + {{end}} {{end}} {{if .Favourited}} <a class="status-like" href="/unlike/{{.ID}}" title="unlike"> diff --git a/templates/thread.tmpl b/templates/thread.tmpl index 9d8f650..afb307b 100644 --- a/templates/thread.tmpl +++ b/templates/thread.tmpl @@ -5,8 +5,8 @@ {{range .Statuses}} {{template "status.tmpl" .}} -{{if $.ReplyContext}}{{if eq .ID $.ReplyContext.InReplyToID}} -{{template "postform.tmpl" $.ReplyContext}} +{{if $.PostContext.ReplyContext}}{{if eq .ID $.PostContext.ReplyContext.InReplyToID}} +{{template "postform.tmpl" $.PostContext}} {{end}}{{end}} {{end}} diff --git a/templates/timeline.tmpl b/templates/timeline.tmpl index 09717c1..6280e65 100644 --- a/templates/timeline.tmpl +++ b/templates/timeline.tmpl @@ -3,7 +3,7 @@ <div class="page-title"> Timeline </div> -{{template "postform.tmpl" }} +{{template "postform.tmpl" .PostContext}} {{range .Statuses}} {{template "status.tmpl" .}} |