diff --git a/pkg/controller/photo/view.go b/pkg/controller/photo/view.go index 6ddb52a..b72687e 100644 --- a/pkg/controller/photo/view.go +++ b/pkg/controller/photo/view.go @@ -90,6 +90,9 @@ func View() http.HandlerFunc { } commentLikeMap := models.MapLikes(currentUser, "comments", commentIDs) + // Populate the user relationships in these comments. + models.SetUserRelationshipsInComments(currentUser, comments) + // Is the current user subscribed to notifications on this thread? _, isSubscribed := models.IsSubscribed(currentUser, "photos", photo.ID) diff --git a/web/templates/partials/user_avatar.html b/web/templates/partials/user_avatar.html index df33ede..9a9ba45 100644 --- a/web/templates/partials/user_avatar.html +++ b/web/templates/partials/user_avatar.html @@ -1,5 +1,24 @@ + +{{define "avatar-24x24"}} +
+ + {{if .ProfilePhoto.ID}} + {{if and (eq .ProfilePhoto.Visibility "private") (not .UserRelationship.IsPrivateGranted)}} + + {{else if and (eq .ProfilePhoto.Visibility "friends") (not .UserRelationship.IsFriend)}} + + {{else}} + + {{end}} + {{else}} + + {{end}} + +
+{{end}} + {{define "avatar-48x48"}}
diff --git a/web/templates/photo/gallery.html b/web/templates/photo/gallery.html index 1890725..27d7447 100644 --- a/web/templates/photo/gallery.html +++ b/web/templates/photo/gallery.html @@ -305,14 +305,8 @@ {{if $Root.UserMap.Has .UserID}} {{$Owner := $Root.UserMap.Get .UserID}}
-