Added user follows
This commit is contained in:
@ -44,10 +44,22 @@ component ProfileHeader(viewUser *arn.User, user *arn.User, uri string)
|
||||
Icon("rocket")
|
||||
span= arn.Capitalize(viewUser.Role)
|
||||
|
||||
//- .profile-actions
|
||||
//- button.action(data-action="followUser", data-trigger="click")
|
||||
//- Icon("user-plus")
|
||||
//- span Follow
|
||||
if user != nil
|
||||
.profile-actions
|
||||
if user.ID != viewUser.ID
|
||||
if !user.Follows().Contains(viewUser.ID)
|
||||
button.profile-action.action(data-action="followUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/add", data-view-user-id=viewUser.ID)
|
||||
Icon("user-plus")
|
||||
span Follow
|
||||
else
|
||||
button.profile-action.action(data-action="unfollowUser", data-trigger="click", data-api="/api/userfollows/" + user.ID + "/remove", data-view-user-id=viewUser.ID)
|
||||
Icon("user-times")
|
||||
span Unfollow
|
||||
|
||||
if user.Role == "admin" || user.Role == "editor"
|
||||
a.button.profile-action(href="/api/user/" + viewUser.ID)
|
||||
Icon("search-plus")
|
||||
span API
|
||||
|
||||
ProfileNavigation(viewUser, uri)
|
||||
|
||||
|
Reference in New Issue
Block a user