diff options
author | r <r@freesoftwareextremist.com> | 2024-02-05 13:08:23 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2024-02-05 13:08:23 +0000 |
commit | 11ea3b4d47a732fe1c6abc39ce452f899f70859f (patch) | |
tree | 80a8fbba346c4bc6e9fe695620911c9749e8ae46 /templates/userlistfollow.tmpl | |
parent | ce0195a8104f34ff18f831754c428aec904c0f89 (diff) | |
download | bloat-11ea3b4d47a732fe1c6abc39ce452f899f70859f.tar.gz bloat-11ea3b4d47a732fe1c6abc39ce452f899f70859f.zip |
Add inline follow/unfollow buttons on follow list page
Diffstat (limited to 'templates/userlistfollow.tmpl')
-rw-r--r-- | templates/userlistfollow.tmpl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/templates/userlistfollow.tmpl b/templates/userlistfollow.tmpl new file mode 100644 index 0000000..298142f --- /dev/null +++ b/templates/userlistfollow.tmpl @@ -0,0 +1,30 @@ +{{with .Data}} +{{if .}} +<table> +{{range .}} + <tr> + <td> {{template "userlistitem.tmpl" (WithContext . $.Ctx)}} </td> + <td> + {{if (ne $.Ctx.UserID .ID)}} + {{if .Pleroma.Relationship.Following}} + <form class="user-list-action" action="/unfollow/{{.ID}}" method="POST"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> + <button type="submit">Unfollow</button> + </form> + {{else}} + <form class="user-list-action" action="/follow/{{.ID}}" method="POST"> + <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}"> + <input type="hidden" name="referrer" value="{{$.Ctx.Referrer}}"> + <button type="submit">Follow</button> + </form> + {{end}} + {{end}} + </td> + </tr> +{{end}} +</table> +{{else}} +<p>No data found</p> +{{end}} +{{end}} |