Skip to content

Commit 0813a58

Browse files
committed
do some changes follow go-gitea#10238 to add review requests num on lists also
change icon for review requests to eye
1 parent 3397d56 commit 0813a58

File tree

7 files changed

+55
-16
lines changed

7 files changed

+55
-16
lines changed

options/locale/locale_en-US.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,8 @@ pulls.approve_count_1 = "%d approval"
11061106
pulls.approve_count_n = "%d approvals"
11071107
pulls.reject_count_1 = "%d change request"
11081108
pulls.reject_count_n = "%d change requests"
1109+
pulls.waiting_count_1 = "%d waiting review"
1110+
pulls.waiting_count_n = "%d waiting reviews"
11091111
11101112
pulls.no_merge_desc = This pull request cannot be merged because all repository merge options are disabled.
11111113
pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually.

routers/repo/issue.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB
289289
reviewTyp := models.ReviewTypeApprove
290290
if typ == "reject" {
291291
reviewTyp = models.ReviewTypeReject
292+
} else if typ == "waiting" {
293+
reviewTyp = models.ReviewTypeRequest
292294
}
293295
for _, count := range counts {
294296
if count.Type == reviewTyp {

routers/user/home.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,8 @@ func Issues(ctx *context.Context) {
632632
reviewTyp := models.ReviewTypeApprove
633633
if typ == "reject" {
634634
reviewTyp = models.ReviewTypeReject
635+
} else if typ == "waiting" {
636+
reviewTyp = models.ReviewTypeRequest
635637
}
636638
for _, count := range counts {
637639
if count.Type == reviewTyp {

templates/repo/issue/list.tmpl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,25 @@
271271
{{if .IsPull}}
272272
{{$approveOfficial := call $approvalCounts .ID "approve"}}
273273
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
274-
{{if or (gt $approveOfficial 0) (gt $rejectOfficial 0)}}
274+
{{$waitingOfficial := call $approvalCounts .ID "waiting"}}
275+
{{if gt $approveOfficial 0}}
275276
<span class="approvals">{{svg "octicon-check" 16}}
276277
{{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
277-
{{if or (gt $rejectOfficial 0)}}
278-
<span class="rejects">{{svg "octicon-x" 16}}
279-
{{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
280-
{{end}}
278+
</span>
281279
{{end}}
280+
281+
{{if gt $rejectOfficial 0}}
282+
<span class="rejects">{{svg "octicon-request-changes" 16}}
283+
{{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
284+
</span>
285+
{{end}}
286+
287+
{{if gt $waitingOfficial 0}}
288+
<span class="waiting">{{svg "octicon-eye" 16}}
289+
{{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
290+
</span>
291+
{{end}}
292+
282293
{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
283294
<span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
284295
{{end}}

templates/repo/issue/milestone_issues.tmpl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,25 @@
241241
{{if .IsPull}}
242242
{{$approveOfficial := call $approvalCounts .ID "approve"}}
243243
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
244-
{{if or (gt $approveOfficial 0) (gt $rejectOfficial 0)}}
244+
{{$waitingOfficial := call $approvalCounts .ID "waiting"}}
245+
{{if gt $approveOfficial 0}}
245246
<span class="approvals">{{svg "octicon-check" 16}}
246247
{{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
247-
{{if or (gt $rejectOfficial 0)}}
248-
<span class="rejects">{{svg "octicon-x" 16}}
249-
{{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
250-
{{end}}
248+
</span>
251249
{{end}}
250+
251+
{{if gt $rejectOfficial 0}}
252+
<span class="rejects">{{svg "octicon-request-changes" 16}}
253+
{{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
254+
</span>
255+
{{end}}
256+
257+
{{if gt $waitingOfficial 0}}
258+
<span class="waiting">{{svg "octicon-eye" 16}}
259+
{{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
260+
</span>
261+
{{end}}
262+
252263
{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
253264
<span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
254265
{{end}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@
470470
</div>
471471
{{else if eq .Type 27}}
472472
<div class="event" id="{{.HashTag}}">
473-
{{svg "octicon-primitive-dot" 16}}
473+
<span class="issue-symbol">{{svg "octicon-eye" 16}}</span>
474474
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
475475
<img src="{{.Poster.RelAvatarLink}}">
476476
</a>

templates/user/dashboard/issues.tmpl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,25 @@
173173
{{if .IsPull}}
174174
{{$approveOfficial := call $approvalCounts .ID "approve"}}
175175
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
176-
{{if or (gt $approveOfficial 0) (gt $rejectOfficial 0) }}
176+
{{$waitingOfficial := call $approvalCounts .ID "waiting"}}
177+
{{if gt $approveOfficial 0}}
177178
<span class="approvals">{{svg "octicon-check" 16}}
178179
{{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
179-
{{if or (gt $rejectOfficial 0)}}
180-
<span class="rejects">{{svg "octicon-x" 16}}
181-
{{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
182-
{{end}}
180+
</span>
181+
{{end}}
182+
183+
{{if gt $rejectOfficial 0}}
184+
<span class="rejects">{{svg "octicon-request-changes" 16}}
185+
{{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
186+
</span>
183187
{{end}}
188+
189+
{{if gt $waitingOfficial 0}}
190+
<span class="waiting">{{svg "octicon-eye" 16}}
191+
{{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
192+
</span>
193+
{{end}}
194+
184195
{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
185196
<span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
186197
{{end}}

0 commit comments

Comments
 (0)