diff options
author | 赵智超 <1012112796@qq.com> | 2020-04-03 13:12:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 02:12:42 -0300 |
commit | f685edf51073ac3be50ff00073a2432b4113bf82 (patch) | |
tree | 77ce0d1aa207f9bb40b6bfc5e2810604851160b0 /templates | |
parent | 3723b0647f61717a249f2379b1fed1e6b4dbdbce (diff) | |
download | gitea-f685edf51073ac3be50ff00073a2432b4113bf82.tar.gz gitea-f685edf51073ac3be50ff00073a2432b4113bf82.zip |
Change review status icons on PR view style to Github style (#10737)
* change the icon of ApproveReview pr from "eye" to "check" like github
* change the icon of RejectReview pr from "x" to "request-change" like github
* add "-" after "{{" which need to be one line (TODO: may be not change all)
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 32 |
2 files changed, 20 insertions, 17 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 2e9d8a32ba..bb8188def9 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -318,7 +318,10 @@ </div> {{else if eq .Type 22}} <div class="event" id="{{.HashTag}}"> - <span class="issue-symbol">{{svg (printf "octicon-%s" .Review.Type.Icon) 16}}</span> + <span class="issue-symbol {{if eq .Review.Type 1}}green + {{- else if eq .Review.Type 2}}grey + {{- else if eq .Review.Type 3}}red + {{- else}}grey{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon) 16}}</span> {{if .OriginalAuthor }} {{else}} <a class="ui avatar image"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 758733fc44..3714e15cfe 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -8,9 +8,9 @@ <div class="ui divider"></div> <div class="review-item"> <span class="type-icon text {{if eq .Type 1}}green - {{else if eq .Type 2}}grey - {{else if eq .Type 3}}red - {{else}}grey{{end}}"> + {{- else if eq .Type 2}}grey + {{- else if eq .Type 3}}red + {{- else}}grey{{end}}"> {{svg (printf "octicon-%s" .Type.Icon) 16}} </span> {{if .Stale}} @@ -40,19 +40,19 @@ {{end}} <div class="comment merge box"> <a class="avatar text - {{if .Issue.PullRequest.HasMerged}}purple - {{else if .Issue.IsClosed}}grey - {{else if .IsPullWorkInProgress}}grey - {{else if .IsFilesConflicted}}grey - {{else if .IsPullRequestBroken}}red - {{else if .IsBlockedByApprovals}}red - {{else if .IsBlockedByRejection}}red - {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red - {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow - {{else if and .RequireSigned (not .WillSign)}}}red - {{else if .Issue.PullRequest.IsChecking}}yellow - {{else if .Issue.PullRequest.CanAutoMerge}}green - {{else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a> + {{- if .Issue.PullRequest.HasMerged}}purple + {{- else if .Issue.IsClosed}}grey + {{- else if .IsPullWorkInProgress}}grey + {{- else if .IsFilesConflicted}}grey + {{- else if .IsPullRequestBroken}}red + {{- else if .IsBlockedByApprovals}}red + {{- else if .IsBlockedByRejection}}red + {{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red + {{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow + {{- else if and .RequireSigned (not .WillSign)}}}red + {{- else if .Issue.PullRequest.IsChecking}}yellow + {{- else if .Issue.PullRequest.CanAutoMerge}}green + {{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a> <div class="content"> {{template "repo/pulls/status" .}} <div class="ui {{if not $.LatestCommitStatus}}top attached header{{else}}attached merge-section segment{{end}}"> |