diff options
author | Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> | 2020-12-20 04:13:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-20 11:13:12 +0800 |
commit | f3c4baa84b8fa7afb3eab137b4c5e3544bd9e761 (patch) | |
tree | b45be56f4fc8a5d1da04649ab2baa7a6a19eefe9 /routers/repo | |
parent | 029836c34c75a277e1e1309f590905a71e5d312a (diff) | |
download | gitea-f3c4baa84b8fa7afb3eab137b4c5e3544bd9e761.tar.gz gitea-f3c4baa84b8fa7afb3eab137b4c5e3544bd9e761.zip |
Show dropdown with all statuses for commit (#13977)
* Show dropdown with all statuses for commit
* Use popups
* Remove unnecessary change
* Style popup
* Use divided list
* As per @silverwind
* Refactor GetLastCommitStatus
* Missing dropdown on repo home and commit page
* Fix tests
* Make status icon be a part of a link on PR list
* Fix missing translation call
* Indent fix
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/blame.go | 1 | ||||
-rw-r--r-- | routers/repo/commit.go | 1 | ||||
-rw-r--r-- | routers/repo/issue.go | 3 | ||||
-rw-r--r-- | routers/repo/view.go | 1 |
4 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/blame.go b/routers/repo/blame.go index 514adc3bc1..9be1ea05af 100644 --- a/routers/repo/blame.go +++ b/routers/repo/blame.go @@ -102,6 +102,7 @@ func RefBlame(ctx *context.Context) { blob := entry.Blob() ctx.Data["LatestCommitStatus"] = models.CalcCommitStatus(statuses) + ctx.Data["LatestCommitStatuses"] = statuses ctx.Data["Paths"] = paths ctx.Data["TreeLink"] = treeLink diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 43a95c2adb..c411d247e2 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -302,6 +302,7 @@ func Diff(ctx *context.Context) { } ctx.Data["CommitStatus"] = models.CalcCommitStatus(statuses) + ctx.Data["CommitStatuses"] = statuses diff, err := gitdiff.GetDiffCommit(repoPath, commitID, setting.Git.MaxGitDiffLines, diff --git a/routers/repo/issue.go b/routers/repo/issue.go index e350f74de9..eec0b7fd96 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -259,7 +259,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti return } - commitStatus[issues[i].PullRequest.ID], _ = pull_service.GetLastCommitStatus(issues[i].PullRequest) + var statuses, _ = pull_service.GetLastCommitStatus(issues[i].PullRequest) + commitStatus[issues[i].PullRequest.ID] = models.CalcCommitStatus(statuses) } } diff --git a/routers/repo/view.go b/routers/repo/view.go index 66ad8e3ad7..8f010490c3 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -359,6 +359,7 @@ func renderDirectory(ctx *context.Context, treeLink string) { } ctx.Data["LatestCommitStatus"] = models.CalcCommitStatus(statuses) + ctx.Data["LatestCommitStatuses"] = statuses // Check permission to add or upload new file. if ctx.Repo.CanWrite(models.UnitTypeCode) && ctx.Repo.IsViewBranch { |