|
|
@@ -247,7 +247,11 @@ func renderDirectory(ctx *context.Context, treeLink string) { |
|
|
|
ctx.Data["ReadmeInList"] = true |
|
|
|
ctx.Data["ReadmeExist"] = true |
|
|
|
ctx.Data["FileIsSymlink"] = readmeFile.isSymlink |
|
|
|
ctx.Data["ReadmeName"] = readmeFile.name |
|
|
|
if ctx.Repo.TreePath == "" { |
|
|
|
ctx.Data["ReadmeRelativePath"] = readmeFile.name |
|
|
|
} else { |
|
|
|
ctx.Data["ReadmeRelativePath"] = ctx.Repo.TreePath + "/" + readmeFile.name |
|
|
|
} |
|
|
|
|
|
|
|
if ctx.Repo.CanEnableEditor() { |
|
|
|
ctx.Data["CanEditFile"] = true |
|
|
@@ -579,11 +583,11 @@ func safeURL(address string) string { |
|
|
|
} |
|
|
|
|
|
|
|
type ContributorInfo struct { |
|
|
|
UserInfo *models.User // nil for contributor who is not a registered user |
|
|
|
RelAvatarLink string `json:"rel_avatar_link"` |
|
|
|
UserName string `json:"user_name"` |
|
|
|
Email string `json:"email"` |
|
|
|
CommitCnt int `json:"commit_cnt"` |
|
|
|
UserInfo *models.User // nil for contributor who is not a registered user |
|
|
|
RelAvatarLink string `json:"rel_avatar_link"` |
|
|
|
UserName string `json:"user_name"` |
|
|
|
Email string `json:"email"` |
|
|
|
CommitCnt int `json:"commit_cnt"` |
|
|
|
} |
|
|
|
|
|
|
|
type GetContributorsInfo struct { |
|
|
@@ -642,7 +646,7 @@ func Home(ctx *context.Context) { |
|
|
|
existedContributorInfo.CommitCnt += c.CommitCnt |
|
|
|
} else { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, "", "",c.Email, c.CommitCnt, |
|
|
|
user, "", "", c.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
@@ -839,7 +843,7 @@ func renderCode(ctx *context.Context) { |
|
|
|
compareInfo, err = baseGitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(), ctx.Repo.BranchName, ctx.Repo.Repository.BaseRepo.DefaultBranch) |
|
|
|
ctx.Data["UpstreamSameBranchName"] = false |
|
|
|
} |
|
|
|
if err==nil && compareInfo != nil { |
|
|
|
if err == nil && compareInfo != nil { |
|
|
|
if compareInfo.Commits != nil { |
|
|
|
log.Info("compareInfoCommits数量:%d", compareInfo.Commits.Len()) |
|
|
|
ctx.Data["FetchUpstreamCnt"] = compareInfo.Commits.Len() |
|
|
@@ -950,7 +954,7 @@ func ContributorsAPI(ctx *context.Context) { |
|
|
|
} else { |
|
|
|
// new committer info |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, user.RelAvatarLink(),user.Name, user.Email,c.CommitCnt, |
|
|
|
user, user.RelAvatarLink(), user.Name, user.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
@@ -963,7 +967,7 @@ func ContributorsAPI(ctx *context.Context) { |
|
|
|
existedContributorInfo.CommitCnt += c.CommitCnt |
|
|
|
} else { |
|
|
|
var newContributor = &ContributorInfo{ |
|
|
|
user, "", "",c.Email,c.CommitCnt, |
|
|
|
user, "", "", c.Email, c.CommitCnt, |
|
|
|
} |
|
|
|
count++ |
|
|
|
contributorInfos = append(contributorInfos, newContributor) |
|
|
|