mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Display commit status on landing page of repo (#1784)
* Display commit status on landing page of repo * improve last status of commits and add link to ci * fix last commit status since the order of ids are desc
This commit is contained in:
committed by
Lunny Xiao
parent
a89692d158
commit
be3319b3d5
@@ -1,3 +1,4 @@
|
||||
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
@@ -120,6 +121,13 @@ func renderDirectory(ctx *context.Context, treeLink string) {
|
||||
ctx.Data["LatestCommitVerification"] = models.ParseCommitWithSignature(latestCommit)
|
||||
ctx.Data["LatestCommitUser"] = models.ValidateCommitWithEmail(latestCommit)
|
||||
|
||||
statuses, err := models.GetLatestCommitStatus(ctx.Repo.Repository, ctx.Repo.Commit.ID.String(), 0)
|
||||
if err != nil {
|
||||
log.Error(3, "GetLatestCommitStatus: %v", err)
|
||||
}
|
||||
|
||||
ctx.Data["LatestCommitStatus"] = models.CalcCommitStatus(statuses)
|
||||
|
||||
// Check permission to add or upload new file.
|
||||
if ctx.Repo.IsWriter() && ctx.Repo.IsViewBranch {
|
||||
ctx.Data["CanAddFile"] = true
|
||||
|
Reference in New Issue
Block a user