-
{{.Context}} {{.Description}}
-
- {{if $.is_context_required}}
- {{if (call $.is_context_required .Context)}}
{{$.locale.Tr "repo.pulls.status_checks_requested"}}
{{end}}
- {{end}}
-
{{if .TargetURL}}{{$.locale.Tr "repo.pulls.status_checks_details"}} {{end}}
+
+ {{range $.LatestCommitStatuses}}
+
+ {{template "repo/commit_status" .}}
+
+
{{.Context}} {{.Description}}
+
-
- {{end}}
+ {{end}}
+
{{end}}
diff --git a/web_src/css/repo.css b/web_src/css/repo.css
index 04cb4eed2d01c..ca18e546f9ae7 100644
--- a/web_src/css/repo.css
+++ b/web_src/css/repo.css
@@ -3284,6 +3284,19 @@ tbody.commit-list {
}
}
+.ui.segment.pr-status-list {
+ padding: 0 0.1em;
+ max-height: 30vh;
+ overflow-x: auto;
+ transition: max-height 0.4s;
+}
+
+.ui.segment.pr-status-list.hide{
+ padding: 0 0.1em;
+ max-height: 0;
+ transition: max-height 0.4s;
+}
+
.pr-status {
padding: 0 !important; /* To clear fomantic's padding on .ui.segment elements */
display: flex;
diff --git a/web_src/js/features/repo-issue-pr-status.js b/web_src/js/features/repo-issue-pr-status.js
new file mode 100644
index 0000000000000..de69101c5ed01
--- /dev/null
+++ b/web_src/js/features/repo-issue-pr-status.js
@@ -0,0 +1,17 @@
+import $ from 'jquery';
+
+export function initRepoPullRequestCommitStatus() {
+ const $prStatusList = $('.pr-status-list');
+
+ $('.hide-all-checks').on('click', async (e) => {
+ e.preventDefault();
+ const $this = $(e.currentTarget);
+ if ($prStatusList.hasClass('hide')) {
+ $prStatusList.removeClass('hide');
+ $this.text($this.attr('data-hide-all'));
+ } else {
+ $prStatusList.addClass('hide');
+ $this.text($this.attr('data-show-all'));
+ }
+ });
+}
diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js
index 5991df6322c57..82ca5951edc0e 100644
--- a/web_src/js/features/repo-legacy.js
+++ b/web_src/js/features/repo-legacy.js
@@ -21,6 +21,7 @@ import {initCommentContent, initMarkupContent} from '../markup/content.js';
import {initCompReactionSelector} from './comp/ReactionSelector.js';
import {initRepoSettingBranches} from './repo-settings.js';
import {initRepoPullRequestMergeForm} from './repo-issue-pr-form.js';
+import {initRepoPullRequestCommitStatus} from './repo-issue-pr-status.js';
import {hideElem, showElem} from '../utils/dom.js';
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
import {attachRefIssueContextPopup} from './contextpopup.js';
@@ -547,6 +548,7 @@ export function initRepository() {
initCompReactionSelector($(document));
initRepoPullRequestMergeForm();
+ initRepoPullRequestCommitStatus();
}
// Pull request
From b56220edf9760d71376c8205def4e31797835899 Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Wed, 2 Aug 2023 04:27:53 +0000
Subject: [PATCH 02/38] fix lint
---
templates/repo/pulls/status.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl
index 06049ff019939..8cb1142fd2bb5 100644
--- a/templates/repo/pulls/status.tmpl
+++ b/templates/repo/pulls/status.tmpl
@@ -15,7 +15,7 @@
{{$.locale.Tr "repo.pulls.status_checking"}}
{{end}}
-
{{$.locale.Tr "repo.pulls.status_checks_hide_all"}}
From 5303f8fe217ccd4c5c3e15ad67fffff31623dfcb Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Wed, 2 Aug 2023 04:35:27 +0000
Subject: [PATCH 03/38] improve
---
web_src/css/repo.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web_src/css/repo.css b/web_src/css/repo.css
index ca18e546f9ae7..330e8b92546ff 100644
--- a/web_src/css/repo.css
+++ b/web_src/css/repo.css
@@ -3285,14 +3285,14 @@ tbody.commit-list {
}
.ui.segment.pr-status-list {
- padding: 0 0.1em;
+ padding: 0 0.1em 0 0;
max-height: 30vh;
overflow-x: auto;
transition: max-height 0.4s;
}
.ui.segment.pr-status-list.hide{
- padding: 0 0.1em;
+ padding: 0 0.1em 0 0;
max-height: 0;
transition: max-height 0.4s;
}
From bd2214ffe23eed38bbb6ee95a0c434325e32a55e Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Wed, 2 Aug 2023 07:27:42 +0000
Subject: [PATCH 04/38] improve
---
web_src/css/repo.css | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/web_src/css/repo.css b/web_src/css/repo.css
index 330e8b92546ff..b7f52e3857341 100644
--- a/web_src/css/repo.css
+++ b/web_src/css/repo.css
@@ -3285,15 +3285,16 @@ tbody.commit-list {
}
.ui.segment.pr-status-list {
- padding: 0 0.1em 0 0;
+ padding: 0;
max-height: 30vh;
- overflow-x: auto;
+ overflow-x: hidden;
transition: max-height 0.4s;
}
.ui.segment.pr-status-list.hide{
- padding: 0 0.1em 0 0;
+ padding: 0;
max-height: 0;
+ overflow-x: hidden;
transition: max-height 0.4s;
}
From 97e60b392d0adface9b7e8c038d798777abb5755 Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Wed, 2 Aug 2023 08:33:03 +0000
Subject: [PATCH 05/38] improve
---
web_src/css/repo.css | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/web_src/css/repo.css b/web_src/css/repo.css
index b7f52e3857341..3370ef15e956a 100644
--- a/web_src/css/repo.css
+++ b/web_src/css/repo.css
@@ -3304,6 +3304,14 @@ tbody.commit-list {
align-items: center;
}
+.pr-status:first-child {
+ border-top: none !important;
+}
+
+.pr-status:last-child {
+ border-bottom: none !important;
+}
+
.pr-status .commit-status {
margin: 1em;
flex-shrink: 0;
From 4a189a54d942ac1e482c74a39ce0b125128c218c Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Thu, 3 Aug 2023 06:07:35 +0000
Subject: [PATCH 06/38] improve tiddy commit status
---
routers/web/repo/pull.go | 3 +
templates/repo/branch/list.tmpl | 4 +-
templates/repo/commit_statuses.tmpl | 16 +++---
templates/repo/issue/view_content/pull.tmpl | 7 ++-
templates/repo/pulls/status.tmpl | 64 ++++++++++++---------
web_src/css/modules/tippy.css | 2 +-
web_src/css/repo.css | 40 +++++++++----
web_src/js/features/repo-issue-pr-status.js | 9 +--
8 files changed, 91 insertions(+), 54 deletions(-)
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index d76e90bf248b8..b7573e46e6171 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -477,6 +477,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *issues_model.Issue)
if len(commitStatuses) != 0 {
ctx.Data["LatestCommitStatuses"] = commitStatuses
ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses)
+ ctx.Data["ShowHideButton"] = true
}
}
@@ -539,6 +540,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
if len(commitStatuses) > 0 {
ctx.Data["LatestCommitStatuses"] = commitStatuses
ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses)
+ ctx.Data["ShowHideButton"] = true
}
compareInfo, err := baseGitRepo.GetCompareInfo(pull.BaseRepo.RepoPath(),
@@ -631,6 +633,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
if len(commitStatuses) > 0 {
ctx.Data["LatestCommitStatuses"] = commitStatuses
ctx.Data["LatestCommitStatus"] = git_model.CalcCommitStatus(commitStatuses)
+ ctx.Data["ShowHideButton"] = true
}
if pb != nil && pb.EnableStatusCheck {
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl
index b32e8cace7748..5754ee98901d3 100644
--- a/templates/repo/branch/list.tmpl
+++ b/templates/repo/branch/list.tmpl
@@ -25,7 +25,7 @@
{{.DefaultBranchBranch.DBBranch.Name}}
{{svg "octicon-copy" 14}}
- {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
+ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID) "root" $}}
{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}
@@ -92,7 +92,7 @@
{{.DBBranch.Name}}
{{svg "octicon-copy" 14}}
- {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
+ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID) "root" $}}
{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}} {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}} {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}
{{end}}
diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl
index 20a59bf0d7171..9dab48d1bb614 100644
--- a/templates/repo/commit_statuses.tmpl
+++ b/templates/repo/commit_statuses.tmpl
@@ -9,14 +9,12 @@
{{end}}
- {{range .Statuses}}
-
- {{end}}
+ {{template "repo/pulls/status" (dict
+ "locale" .root.locale
+ "CommitStatuses" .Statuses
+ "CommitStatus" .Status
+ "IsTippy" true
+ "is_context_required" .root.is_context_required
+ )}}
{{end}}
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 214d77a12d434..d9d38c6edbeb6 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -20,7 +20,12 @@
{{- else if .Issue.PullRequest.CanAutoMerge}}green
{{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}
- {{template "repo/pulls/status" .}}
+ {{template "repo/pulls/status" (dict
+ "locale" .locale
+ "CommitStatus" .LatestCommitStatus
+ "CommitStatuses" .LatestCommitStatuses
+ "is_context_required" .is_context_required
+ )}}
{{$showGeneralMergeForm := false}}