diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-06-30 15:57:59 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-06-30 08:57:59 +0100 |
commit | ff85dd3e12c05be98d9132de2e629523d096f712 (patch) | |
tree | c0b5d69eef2fd859204437bd8b206e06a7b8a47d /templates | |
parent | 1e46eedce721e22e3e1e94eec6e0afccd36147c1 (diff) | |
download | gitea-ff85dd3e12c05be98d9132de2e629523d096f712.tar.gz gitea-ff85dd3e12c05be98d9132de2e629523d096f712.zip |
Add commit statuses reports on pull request view (#6845)
* Add commit statuses reports on pull view
* Add some translations
* improve the UI
* fix fmt
* fix tests
* add a new test git repo to fix tests
* fix bug when headRepo or headBranch missing
* fix tests
* fix tests
* fix consistency
* fix tests
* fix tests
* change the test repo
* fix tests
* fix tests
* fix migration
* keep db size consistency
* fix translation
* change commit hash status table unique index
* remove unused table
* use char instead varchar
* make hashCommitStatusContext private
* split merge section with status check on pull view ui
* fix tests; fix arc-green theme on pull ui
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 3 | ||||
-rw-r--r-- | templates/repo/pulls/status.tmpl | 21 |
2 files changed, 23 insertions, 1 deletions
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 73c4179080..caadba41c7 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -45,7 +45,8 @@ {{else if .Issue.PullRequest.CanAutoMerge}}green {{else}}red{{end}}"><span class="mega-octicon octicon-git-merge"></span></a> <div class="content"> - <div class="ui merge segment"> + {{template "repo/pulls/status" .}} + <div class="ui attached merge-section segment"> {{if .Issue.PullRequest.HasMerged}} <div class="item text purple"> {{$.i18n.Tr "repo.pulls.has_merged"}} diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl new file mode 100644 index 0000000000..e1401aa8bb --- /dev/null +++ b/templates/repo/pulls/status.tmpl @@ -0,0 +1,21 @@ +{{if $.LatestCommitStatus}} + <div class="ui top attached header"> + {{if eq .LatestCommitStatus.State "pending"}} + {{$.i18n.Tr "repo.pulls.status_checking"}} + {{else if eq .LatestCommitStatus.State "success"}} + {{$.i18n.Tr "repo.pulls.status_checks_success"}} + {{else if eq .LatestCommitStatus.State "error"}} + {{$.i18n.Tr "repo.pulls.status_checks_error"}} + {{else}} + {{$.i18n.Tr "repo.pulls.status_checking"}} + {{end}} + </div> + + {{range $.LatestCommitStatuses}} + <div class="ui attached segment"> + <span>{{template "repo/commit_status" .}}</span> + <span class="ui">{{.Context}} <span class="text grey">{{.Description}}</span></span> + <div class="ui right">{{if .TargetURL}}<a href="{{.TargetURL}}">Details</a>{{end}}</div> + </div> + {{end}} +{{end}}
\ No newline at end of file |