Updated dashboard to include following list
This commit is contained in:
parent
facd70e094
commit
cb01452c44
@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const maxPosts = 5
|
||||
const maxFollowing = 5
|
||||
|
||||
// Get dashboard.
|
||||
func Get(ctx *aero.Context) string {
|
||||
@ -30,5 +31,13 @@ func Get(ctx *aero.Context) string {
|
||||
posts = posts[:maxPosts]
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Dashboard(posts))
|
||||
userList, err := arn.DB.GetMany("User", user.Following[:maxFollowing])
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(500, "Error fetching following", err)
|
||||
}
|
||||
|
||||
followingList := userList.([]*arn.User)
|
||||
|
||||
return ctx.HTML(components.Dashboard(posts, followingList))
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
component Dashboard(posts []*arn.Post)
|
||||
component Dashboard(posts []*arn.Post, followers []*arn.User)
|
||||
h2.page-title Dash
|
||||
|
||||
.widgets
|
||||
@ -41,11 +41,11 @@ component Dashboard(posts []*arn.Post)
|
||||
.widget.mountable
|
||||
h3.widget-title Contacts
|
||||
|
||||
for i := 1; i <= 5; i++
|
||||
.widget-element
|
||||
each follower in followers
|
||||
a.widget-element.ajax(href="/+" + follower.Nick)
|
||||
.widget-element-text
|
||||
Icon("address-card")
|
||||
span ...
|
||||
span!= follower.Nick
|
||||
|
||||
.widget.mountable
|
||||
h3.widget-title Follow
|
||||
|
Loading…
Reference in New Issue
Block a user