Improved dashboard
This commit is contained in:
parent
8c631f4e26
commit
7c5d0bbcff
@ -27,7 +27,6 @@ func Get(ctx *aero.Context) string {
|
|||||||
func dashboard(ctx *aero.Context) string {
|
func dashboard(ctx *aero.Context) string {
|
||||||
var posts []*arn.Post
|
var posts []*arn.Post
|
||||||
var err error
|
var err error
|
||||||
var followIDList []string
|
|
||||||
var userList interface{}
|
var userList interface{}
|
||||||
var followingList []*arn.User
|
var followingList []*arn.User
|
||||||
|
|
||||||
@ -38,8 +37,7 @@ func dashboard(ctx *aero.Context) string {
|
|||||||
arn.SortPostsLatestFirst(posts)
|
arn.SortPostsLatestFirst(posts)
|
||||||
posts = arn.FilterPostsWithUniqueThreads(posts, maxPosts)
|
posts = arn.FilterPostsWithUniqueThreads(posts, maxPosts)
|
||||||
}, func() {
|
}, func() {
|
||||||
followIDList = user.Following
|
userList, err = arn.DB.GetMany("User", user.Following)
|
||||||
userList, err = arn.DB.GetMany("User", followIDList)
|
|
||||||
followingList = userList.([]*arn.User)
|
followingList = userList.([]*arn.User)
|
||||||
followingList = arn.SortUsersLastSeen(followingList)
|
followingList = arn.SortUsersLastSeen(followingList)
|
||||||
|
|
||||||
|
@ -38,15 +38,20 @@ component Dashboard(posts []*arn.Post, following []*arn.User)
|
|||||||
Icon("comment")
|
Icon("comment")
|
||||||
span ...
|
span ...
|
||||||
|
|
||||||
if len(following) > 0
|
.widget.mountable
|
||||||
.widget.mountable
|
h3.widget-title Contacts
|
||||||
h3.widget-title Contacts
|
|
||||||
|
|
||||||
each user in following
|
for i := 0; i <= 4; i++
|
||||||
a.widget-element.ajax(href="/+" + user.Nick)
|
if i < len(following)
|
||||||
|
a.widget-element.ajax(href="/+" + following[i].Nick)
|
||||||
.widget-element-text
|
.widget-element-text
|
||||||
Icon("address-card")
|
Icon("address-card")
|
||||||
span= user.Nick
|
span= following[i].Nick
|
||||||
|
else
|
||||||
|
.widget-element
|
||||||
|
.widget-element-text
|
||||||
|
Icon("address-card")
|
||||||
|
span ...
|
||||||
|
|
||||||
.widget.mountable
|
.widget.mountable
|
||||||
h3.widget-title Follow
|
h3.widget-title Follow
|
||||||
|
Loading…
Reference in New Issue
Block a user