mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-01 02:57:17 +00:00
Remove account relationship buttons for logged in user's page
This commit is contained in:
parent
1e44d5d3d5
commit
a68a09a83e
|
@ -31,6 +31,15 @@ type CommonData struct {
|
||||||
NavbarData *NavbarData
|
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 {
|
type ErrorData struct {
|
||||||
*CommonData
|
*CommonData
|
||||||
Error string
|
Error string
|
||||||
|
@ -69,12 +78,13 @@ type NotificationData struct {
|
||||||
|
|
||||||
type UserData struct {
|
type UserData struct {
|
||||||
*CommonData
|
*CommonData
|
||||||
User *mastodon.Account
|
User *mastodon.Account
|
||||||
Type string
|
IsCurrent bool
|
||||||
Users []*mastodon.Account
|
Type string
|
||||||
Statuses []*mastodon.Status
|
Users []*mastodon.Account
|
||||||
NextLink string
|
Statuses []*mastodon.Status
|
||||||
DarkMode bool
|
NextLink string
|
||||||
|
DarkMode bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserSearchData struct {
|
type UserSearchData struct {
|
||||||
|
|
|
@ -527,6 +527,7 @@ func (svc *service) ServeUserPage(ctx context.Context, c *model.Client,
|
||||||
|
|
||||||
data := &renderer.UserData{
|
data := &renderer.UserData{
|
||||||
User: user,
|
User: user,
|
||||||
|
IsCurrent: commonData.IsCurrentUser(user.ID),
|
||||||
Type: pageType,
|
Type: pageType,
|
||||||
Users: users,
|
Users: users,
|
||||||
Statuses: statuses,
|
Statuses: statuses,
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
source
|
source
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{if not .IsCurrent}}
|
||||||
<div>
|
<div>
|
||||||
<span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>
|
<span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>
|
||||||
{{if .User.Pleroma.Relationship.Following}}
|
{{if .User.Pleroma.Relationship.Following}}
|
||||||
|
@ -64,6 +65,7 @@
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
<div>
|
<div>
|
||||||
<a href="/user/{{.User.ID}}"> statuses ({{.User.StatusesCount}}) </a> -
|
<a href="/user/{{.User.ID}}"> statuses ({{.User.StatusesCount}}) </a> -
|
||||||
<a href="/user/{{.User.ID}}/following"> following ({{.User.FollowingCount}}) </a> -
|
<a href="/user/{{.User.ID}}/following"> following ({{.User.FollowingCount}}) </a> -
|
||||||
|
|
Loading…
Reference in a new issue