From 839375653ac0b77875079305f5b2772c02a9b69f Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 14 Jul 2025 15:22:03 +0300 Subject: [PATCH] appview/pages: show tiny avatar in more places Also fixes OrderedReactionKinds breaking patch/interdiff pages. Signed-off-by: Anirudh Oppiliappan --- appview/pages/pages.go | 38 ++++++++++--------- appview/pages/templates/layouts/topbar.html | 2 +- appview/pages/templates/repo/commit.html | 2 +- appview/pages/templates/repo/index.html | 2 +- .../repo/issues/fragments/issueComment.html | 12 +++--- .../pages/templates/repo/issues/issue.html | 2 +- appview/pages/templates/repo/log.html | 4 +- .../repo/pulls/fragments/pullHeader.html | 6 ++- .../repo/pulls/fragments/pullNewComment.html | 7 ++-- appview/pages/templates/repo/pulls/pull.html | 14 +++---- appview/pages/templates/repo/tree.html | 8 +++- 11 files changed, 53 insertions(+), 44 deletions(-) diff --git a/appview/pages/pages.go b/appview/pages/pages.go index 8922c04..46ce7cc 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -691,16 +691,16 @@ type RepoSingleIssueParams struct { DidHandleMap map[string]string OrderedReactionKinds []db.ReactionKind - Reactions map[db.ReactionKind]int - UserReacted map[db.ReactionKind]bool + Reactions map[db.ReactionKind]int + UserReacted map[db.ReactionKind]bool State string } type ThreadReactionFragmentParams struct { ThreadAt syntax.ATURI - Kind db.ReactionKind - Count int + Kind db.ReactionKind + Count int IsReacted bool } @@ -825,14 +825,15 @@ func (p *Pages) RepoSinglePull(w io.Writer, params RepoSinglePullParams) error { } type RepoPullPatchParams struct { - LoggedInUser *oauth.User - DidHandleMap map[string]string - RepoInfo repoinfo.RepoInfo - Pull *db.Pull - Stack db.Stack - Diff *types.NiceDiff - Round int - Submission *db.PullSubmission + LoggedInUser *oauth.User + DidHandleMap map[string]string + RepoInfo repoinfo.RepoInfo + Pull *db.Pull + Stack db.Stack + Diff *types.NiceDiff + Round int + Submission *db.PullSubmission + OrderedReactionKinds []db.ReactionKind } // this name is a mouthful @@ -841,12 +842,13 @@ func (p *Pages) RepoPullPatchPage(w io.Writer, params RepoPullPatchParams) error } type RepoPullInterdiffParams struct { - LoggedInUser *oauth.User - DidHandleMap map[string]string - RepoInfo repoinfo.RepoInfo - Pull *db.Pull - Round int - Interdiff *patchutil.InterdiffResult + LoggedInUser *oauth.User + DidHandleMap map[string]string + RepoInfo repoinfo.RepoInfo + Pull *db.Pull + Round int + Interdiff *patchutil.InterdiffResult + OrderedReactionKinds []db.ReactionKind } // this name is a mouthful diff --git a/appview/pages/templates/layouts/topbar.html b/appview/pages/templates/layouts/topbar.html index d2db845..d1bc016 100644 --- a/appview/pages/templates/layouts/topbar.html +++ b/appview/pages/templates/layouts/topbar.html @@ -39,7 +39,7 @@ class="cursor-pointer list-none flex items-center" > {{ $user := didOrHandle .Did .Handle }} - {{ template "user/fragments/picHandle" $user }} + {{ template "user/fragments/picHandleLink" $user }}
{{ i "user" "w-4 h-4" }} {{ $committerDidOrHandle := index $.EmailToDidOrHandle $commit.Committer.Email }} - {{ $committerDidOrHandle }} + {{ template "user/fragments/picHandleLink" $committerDidOrHandle }}
SSH Key Fingerprint:
diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html index 55e5abd..c039296 100644 --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -266,7 +266,7 @@ {{ end }}" class="text-gray-500 dark:text-gray-400 no-underline hover:underline" >{{ if $didOrHandle }} - {{ $didOrHandle }} + {{ template "user/fragments/picHandleLink" $didOrHandle }} {{ else }} {{ .Author.Name }} {{ end }} -
+
{{ $owner := index $.DidHandleMap .OwnerDid }} - {{ $owner }} + {{ template "user/fragments/picHandleLink" $owner }} - + {{ $isIssueAuthor := eq .OwnerDid $.Issue.OwnerDid }} {{ if $isIssueAuthor }} @@ -29,15 +29,15 @@ {{ $isCommentOwner := and $.LoggedInUser (eq $.LoggedInUser.Did .OwnerDid) }} {{ if and $isCommentOwner (not .Deleted) }} - -