diff --git a/pages/dashboard/dashboard.go b/pages/dashboard/dashboard.go index 97cc72fe..4552a98c 100644 --- a/pages/dashboard/dashboard.go +++ b/pages/dashboard/dashboard.go @@ -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)) } diff --git a/pages/dashboard/dashboard.pixy b/pages/dashboard/dashboard.pixy index ab0d9c5d..7f2aa69f 100644 --- a/pages/dashboard/dashboard.pixy +++ b/pages/dashboard/dashboard.pixy @@ -1,6 +1,6 @@ -component Dashboard(posts []*arn.Post) +component Dashboard(posts []*arn.Post, followers []*arn.User) h2.page-title Dash - + .widgets .widget.mountable h3.widget-title Schedule @@ -10,7 +10,7 @@ component Dashboard(posts []*arn.Post) .widget-element-text Icon("calendar-o") span ... - + .widget.mountable h3.widget-title Forums @@ -19,7 +19,7 @@ component Dashboard(posts []*arn.Post) .widget-element-text Icon(arn.GetForumIcon(post.Thread().Tags[0])) span= post.Thread().Title - + .widget.mountable h3.widget-title Groups @@ -37,16 +37,16 @@ component Dashboard(posts []*arn.Post) .widget-element-text Icon("comment") span ... - + .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 @@ -54,23 +54,23 @@ component Dashboard(posts []*arn.Post) .widget-element-text Icon("microphone") span Discord - + a.widget-element(href="https://www.facebook.com/animenotifier", target="_blank", rel="noopener") .widget-element-text Icon("facebook") span Facebook - + a.widget-element(href="https://twitter.com/animenotifier", target="_blank", rel="noopener") .widget-element-text Icon("twitter") span Twitter - + a.widget-element(href="https://plus.google.com/+AnimeReleaseNotifierOfficial", target="_blank", rel="noopener") .widget-element-text Icon("google-plus") span Google+ - + a.widget-element(href="https://github.com/animenotifier/notify.moe", target="_blank", rel="noopener") .widget-element-text Icon("github") - span GitHub \ No newline at end of file + span GitHub