diff options
author | r <r@freesoftwareextremist.com> | 2021-01-16 09:10:02 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2021-01-16 09:49:15 +0000 |
commit | 91f68ccfb391ee53bfc36f4877ca8d8f63c8faf2 (patch) | |
tree | 1e1511a2d80840a68e81ad0a666bd8c2a7e105e4 /templates | |
parent | 384179e518c8d01a126e716a3f80a9543683e593 (diff) | |
download | bloat-91f68ccfb391ee53bfc36f4877ca8d8f63c8faf2.tar.gz bloat-91f68ccfb391ee53bfc36f4877ca8d8f63c8faf2.zip |
Add follow request support
Diffstat (limited to 'templates')
-rw-r--r-- | templates/notification.tmpl | 29 | ||||
-rw-r--r-- | templates/requestlist.tmpl | 34 | ||||
-rw-r--r-- | templates/user.tmpl | 13 |
3 files changed, 72 insertions, 4 deletions
diff --git a/templates/notification.tmpl b/templates/notification.tmpl index 3977aa7..5563425 100644 --- a/templates/notification.tmpl +++ b/templates/notification.tmpl @@ -38,6 +38,35 @@ </div> </div> + {{else if eq .Type "follow_request"}} + <div class="notification-follow-container"> + <div class="status-profile-img-container"> + <a class="img-link" href="/user/{{.Account.ID}}"> + <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="@{{.Account.Acct}}" alt="profile-avatar" height="48" /> + </a> + </div> + <div class="notification-follow"> + <div class="notification-info-text"> + <bdi class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </bdi> + <span class="notification-text"> wants to follow you - + <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}">{{TimeSince .CreatedAt}}</time> + </span> + </div> + <div> + <a href="/user/{{.Account.ID}}"> <span class="status-uname"> @{{.Account.Acct}} </span> </a> + </div> + <form class="d-inline" action="/accept/{{.Account.ID}}" method="post" target="_self"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="submit" value="accept" class="btn-link"> + </form> + - + <form class="d-inline" action="/reject/{{.Account.ID}}" method="post" target="_self"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="submit" value="reject" class="btn-link"> + </form> + </div> + </div> + {{else if eq .Type "mention"}} {{template "status" (WithContext .Status $.Ctx)}} diff --git a/templates/requestlist.tmpl b/templates/requestlist.tmpl new file mode 100644 index 0000000..232b56d --- /dev/null +++ b/templates/requestlist.tmpl @@ -0,0 +1,34 @@ +{{with .Data}} +<div> + {{range .}} + <div class="user-list-item"> + <div class="user-list-profile-img"> + <a class="img-link" href="/user/{{.ID}}"> + <img class="status-profile-img" src="{{.AvatarStatic}}" title="@{{.Acct}}" alt="avatar" height="48" /> + </a> + </div> + <div class="user-list-name"> + <div> + <div class="status-dname"> {{EmojiFilter .DisplayName .Emojis}} </div> + <a class="img-link" href="/user/{{.ID}}"> + <div class="status-uname"> @{{.Acct}} </div> + </a> + </div> + <form class="d-inline" action="/accept/{{.ID}}" method="post" target="_self"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="submit" value="accept" class="btn-link"> + </form> + - + <form class="d-inline" action="/reject/{{.ID}}" method="post" target="_self"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="submit" value="reject" class="btn-link"> + </form> + </div> + </div> + {{else}} + <div class="no-data-found">No data found</div> + {{end}} +</div> +{{else}} +<div class="no-data-found">No data found</div> +{{end}} diff --git a/templates/user.tmpl b/templates/user.tmpl index b3461c6..5ef411a 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -99,10 +99,11 @@ </div> {{if .IsCurrent}} <div> - <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a> - - <a href="/user/{{.User.ID}}/likes"> likes </a> - - <a href="/user/{{.User.ID}}/mutes"> mutes </a> - - <a href="/user/{{.User.ID}}/blocks"> blocks </a> + <a href="/user/{{.User.ID}}/bookmarks"> bookmarks </a> + - <a href="/user/{{.User.ID}}/likes"> likes </a> + - <a href="/user/{{.User.ID}}/mutes"> mutes </a> + - <a href="/user/{{.User.ID}}/blocks"> blocks </a> + {{if .User.Locked}}- <a href="/user/{{.User.ID}}/requests"> requests </a>{{end}} </div> {{end}} <div> @@ -162,6 +163,10 @@ {{else if eq .Type "blocks"}} <div class="page-title"> Blocks </div> {{template "userlist.tmpl" (WithContext .Users $.Ctx)}} + +{{else if eq .Type "requests"}} +<div class="page-title"> Follow requests </div> +{{template "requestlist.tmpl" (WithContext .Users $.Ctx)}} {{end}} <div class="pagination"> |