From 56ccb9db30262d4caa721601f55f146dece8ef64 Mon Sep 17 00:00:00 2001 From: avadesian Date: Thu, 8 Jul 2021 12:44:50 +0800 Subject: [PATCH] use email text value and add user's customized image --- modules/git/repo.go | 2 +- templates/repo/home.tmpl | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/git/repo.go b/modules/git/repo.go index 386a8909d..a2a4d28af 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -460,7 +460,7 @@ func GetContributors(repoPath string) ([]Contributor, error){ commitCnt, _ := strconv.Atoi(number) committer := oneCount[strings.Index(oneCount, "\t")+1:strings.LastIndex(oneCount, " ")] committer = strings.Trim(committer, " ") - email := oneCount[strings.LastIndex(oneCount, " ")+1:] + email := oneCount[strings.Index(oneCount, "<")+1:strings.Index(oneCount, ">")] contributorsInfo[i] = Contributor{ commitCnt, committer, email, } diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 63f80104e..52d819459 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -180,14 +180,12 @@
{{range .ContributorInfo}} {{/*  {{.UserInfo.Name}}*/}} - {{if .Email}} -   {{.Email}} + {{if .UserInfo}} + + {{else if .Email}} + {{end}} {{end}} - - - -