Remove account relationship buttons for logged in user's page

master
r 3 years ago
parent 1e44d5d3d5
commit a68a09a83e
  1. 22
      renderer/model.go
  2. 1
      service/service.go
  3. 2
      templates/user.tmpl

@ -31,6 +31,15 @@ type CommonData struct {
NavbarData *NavbarData
}
func (c CommonData) IsCurrentUser(id string) bool {
if c.NavbarData != nil &&
c.NavbarData.User != nil &&
c.NavbarData.User.ID == id {
return true
}
return false
}
type ErrorData struct {
*CommonData
Error string
@ -69,12 +78,13 @@ type NotificationData struct {
type UserData struct {
*CommonData
User *mastodon.Account
Type string
Users []*mastodon.Account
Statuses []*mastodon.Status
NextLink string
DarkMode bool
User *mastodon.Account
IsCurrent bool
Type string
Users []*mastodon.Account
Statuses []*mastodon.Status
NextLink string
DarkMode bool
}
type UserSearchData struct {

@ -527,6 +527,7 @@ func (svc *service) ServeUserPage(ctx context.Context, c *model.Client,
data := &renderer.UserData{
User: user,
IsCurrent: commonData.IsCurrentUser(user.ID),
Type: pageType,
Users: users,
Statuses: statuses,

@ -18,6 +18,7 @@
source
</a>
</div>
{{if not .IsCurrent}}
<div>
<span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>
{{if .User.Pleroma.Relationship.Following}}
@ -64,6 +65,7 @@
</form>
{{end}}
</div>
{{end}}
<div>
<a href="/user/{{.User.ID}}"> statuses ({{.User.StatusesCount}}) </a> -
<a href="/user/{{.User.ID}}/following"> following ({{.User.FollowingCount}}) </a> -

Loading…
Cancel
Save