Updated dashboard
This commit is contained in:
parent
cb01452c44
commit
1cd798e947
@ -31,10 +31,16 @@ func Get(ctx *aero.Context) string {
|
|||||||
posts = posts[:maxPosts]
|
posts = posts[:maxPosts]
|
||||||
}
|
}
|
||||||
|
|
||||||
userList, err := arn.DB.GetMany("User", user.Following[:maxFollowing])
|
followIDList := user.Following
|
||||||
|
|
||||||
|
if len(followIDList) > maxFollowing {
|
||||||
|
followIDList = followIDList[:maxFollowing]
|
||||||
|
}
|
||||||
|
|
||||||
|
userList, err := arn.DB.GetMany("User", followIDList)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx.Error(500, "Error fetching following", err)
|
return ctx.Error(500, "Error fetching followers", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
followingList := userList.([]*arn.User)
|
followingList := userList.([]*arn.User)
|
||||||
|
@ -38,14 +38,15 @@ component Dashboard(posts []*arn.Post, followers []*arn.User)
|
|||||||
Icon("comment")
|
Icon("comment")
|
||||||
span ...
|
span ...
|
||||||
|
|
||||||
.widget.mountable
|
if len(followers) > 0
|
||||||
h3.widget-title Contacts
|
.widget.mountable
|
||||||
|
h3.widget-title Contacts
|
||||||
|
|
||||||
each follower in followers
|
each follower in followers
|
||||||
a.widget-element.ajax(href="/+" + follower.Nick)
|
a.widget-element.ajax(href="/+" + follower.Nick)
|
||||||
.widget-element-text
|
.widget-element-text
|
||||||
Icon("address-card")
|
Icon("address-card")
|
||||||
span!= follower.Nick
|
span= follower.Nick
|
||||||
|
|
||||||
.widget.mountable
|
.widget.mountable
|
||||||
h3.widget-title Follow
|
h3.widget-title Follow
|
||||||
|
Loading…
Reference in New Issue
Block a user