diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -162,7 +162,7 @@ pairs = append(pairs, []string{values[i], values[i+1]}) } return pairs, nil }, - "append": func(s []string, values ...string) []string { + "append": func(s []any, values ...any) []any { s = append(s, values...) return s }, diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -25,17 +25,11 @@
-

- {{ $did := index $.EmailToDid $commit.Author.Email }} - - {{ if $did }} - {{ template "user/fragments/picHandleLink" $did }} - {{ else }} - {{ $commit.Author.Name }} - {{ end }} +

+ {{ template "attribution" . }} - {{ template "repo/fragments/time" $commit.Committer.When }} + {{ template "repo/fragments/time" $commit.Committer.When }} {{ slice $commit.This 0 8 }} @@ -78,6 +72,37 @@

{{end}} + +{{ define "attribution" }} + {{ $commit := .Diff.Commit }} + {{ $showCommitter := true }} + {{ if eq $commit.Author.Email $commit.Committer.Email }} + {{ $showCommitter = false }} + {{ end }} + + {{ if $showCommitter }} + authored by {{ template "attributedUser" (list $commit.Author.Email $commit.Author.Name $.EmailToDid) }} + {{ range $commit.CoAuthors }} + {{ template "attributedUser" (list .Email .Name $.EmailToDid) }} + {{ end }} + and committed by {{ template "attributedUser" (list $commit.Committer.Email $commit.Committer.Name $.EmailToDid) }} + {{ else }} + {{ template "attributedUser" (list $commit.Author.Email $commit.Author.Name $.EmailToDid )}} + {{ end }} +{{ end }} + +{{ define "attributedUser" }} + {{ $email := index . 0 }} + {{ $name := index . 1 }} + {{ $map := index . 2 }} + {{ $did := index $map $email }} + + {{ if $did }} + {{ template "user/fragments/picHandleLink" $did }} + {{ else }} + {{ $name }} + {{ end }} +{{ end }} {{ define "topbarLayout" }}
diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -14,7 +14,7 @@ {{ block "repoLanguages" . }}{{ end }} {{ end }}
{{ block "branchSelector" . }}{{ end }} -
+
{{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }} @@ -66,7 +66,7 @@ {{ end }} {{ define "branchSelector" }}
-
+