Added user follows

This commit is contained in:
2017-07-21 10:10:48 +02:00
parent 8a72b76d27
commit 524ab3fff9
10 changed files with 126 additions and 18 deletions

View File

@ -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)