From 11ea3b4d47a732fe1c6abc39ce452f899f70859f Mon Sep 17 00:00:00 2001 From: r Date: Mon, 5 Feb 2024 13:08:23 +0000 Subject: Add inline follow/unfollow buttons on follow list page --- templates/user.tmpl | 10 +++++----- templates/userlistfollow.tmpl | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 templates/userlistfollow.tmpl (limited to 'templates') diff --git a/templates/user.tmpl b/templates/user.tmpl index 8f47929..f34a9df 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -16,7 +16,7 @@ source - {{if not .IsCurrent}} + {{if (ne $.Ctx.UserID .User.ID)}}
{{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} {{if .User.Pleroma.Relationship.BlockedBy}} blocks you - {{end}} @@ -104,7 +104,7 @@ followers ({{.User.FollowersCount}}) - media
- {{if .IsCurrent}} + {{if (eq $.Ctx.UserID .User.ID)}}
bookmarks - likes @@ -115,7 +115,7 @@ {{end}}
search statuses - {{if .IsCurrent}} - filters {{end}} + {{if (eq $.Ctx.UserID .User.ID)}} - filters {{end}}
@@ -140,11 +140,11 @@ {{else if eq .Type "following"}}

Following

-{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} +{{template "userlistfollow.tmpl" (WithContext .Users $.Ctx)}} {{else if eq .Type "followers"}}

Followers

-{{template "userlist.tmpl" (WithContext .Users $.Ctx)}} +{{template "userlistfollow.tmpl" (WithContext .Users $.Ctx)}} {{else if eq .Type "media"}}

Statuses with media

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 .}} + +{{range .}} + + + + +{{end}} +
{{template "userlistitem.tmpl" (WithContext . $.Ctx)}} + {{if (ne $.Ctx.UserID .ID)}} + {{if .Pleroma.Relationship.Following}} +
+ + + +
+ {{else}} +
+ + + +
+ {{end}} + {{end}} +
+{{else}} +

No data found

+{{end}} +{{end}} -- cgit v1.2.3