|
|
@@ -569,19 +569,18 @@ func safeURL(address string) string { |
|
|
|
|
|
|
|
type ContributorInfo struct { |
|
|
|
UserInfo *models.User |
|
|
|
Email string |
|
|
|
Email string // for contributor who is not a registered user |
|
|
|
} |
|
|
|
// Home render repository home page |
|
|
|
func Home(ctx *context.Context) { |
|
|
|
if len(ctx.Repo.Units) > 0 { |
|
|
|
//get repo contributors info |
|
|
|
contributors, err := git.GetContributors(ctx.Repo.Repository.RepoPath()) |
|
|
|
if err != nil && contributors != nil { |
|
|
|
fmt.Printf("contributors:%v",contributors) |
|
|
|
contributorInfos := make([]*ContributorInfo, len(contributors)) |
|
|
|
if err == nil && contributors != nil { |
|
|
|
var contributorInfos []*ContributorInfo |
|
|
|
for _, c := range contributors { |
|
|
|
user,err := models.GetUserByEmail(c.Email) |
|
|
|
if err != nil { |
|
|
|
if err == nil { |
|
|
|
contributorInfos = append(contributorInfos, &ContributorInfo{ |
|
|
|
user, c.Email, |
|
|
|
}) |
|
|
|