From 8697a7a30d5d672c00d13c4c92ffadaebe610ecf Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 15 Dec 2025 14:51:10 +0200 Subject: [PATCH] appview/pages: render a placeholder avatar when there's no did Change-Id: ptqmznvuxylzrkuozxvtsqoskoqrruww Signed-off-by: Anirudh Oppiliappan --- appview/pages/funcmap.go | 1 - appview/pages/templates/repo/commit.html | 5 ++++- appview/pages/templates/repo/index.html | 8 ++++++-- appview/pages/templates/repo/log.html | 6 +++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index bee78e3e..4b04e6a8 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -421,7 +421,6 @@ func (p *Pages) resolveDid(did string) string { func (p *Pages) AvatarUrl(handle, size string) string { handle = strings.TrimPrefix(handle, "@") - handle = p.resolveDid(handle) secret := p.avatar.SharedSecret diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index 0fe7d92a..f297ad0a 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -100,7 +100,10 @@ {{ if $did }} {{ template "user/fragments/picHandleLink" $did }} {{ else }} - {{ $name }} + + {{ placeholderAvatar "tiny" }} + {{ $name }} + {{ end }} {{ end }} diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html index abb27b78..99264535 100644 --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -259,7 +259,7 @@ {{ define "attribution" }} {{ $commit := index . 0 }} {{ $map := index . 1 }} - + {{ $author := index $map $commit.Author.Email }} {{ $coauthors := $commit.CoAuthors }} {{ $all := list }} @@ -274,7 +274,11 @@ {{ end }} {{ end }} - {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} + {{ if $author }} + {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} + {{ else }} + {{ placeholderAvatar "tiny" }} + {{ end }} {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }} diff --git a/appview/pages/templates/repo/log.html b/appview/pages/templates/repo/log.html index a1cb4167..37473b46 100644 --- a/appview/pages/templates/repo/log.html +++ b/appview/pages/templates/repo/log.html @@ -186,7 +186,11 @@ {{ end }} {{ end }} - {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} + {{ if $author }} + {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} + {{ else }} + {{ placeholderAvatar "tiny" }} + {{ end }} {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }} -- 2.43.0