Performance improvements for pull request list page (#29900)
This PR will avoid load pullrequest.Issue twice in pull request list page. It will reduce x times database queries for those WIP pull requests. Partially fix #29585 --------- Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit 62f8174aa2fae1481c7e17a6afcb731a5b178cd0) Conflicts: models/activities/notification_list.go moved to models/activities/notification.go
This commit is contained in:
parent
0f4614004e
commit
d92c2048b3
14 changed files with 86 additions and 50 deletions
|
@ -1,15 +1,15 @@
|
|||
{{if .IsPull}}
|
||||
{{if and .PullRequest .PullRequest.HasMerged}}
|
||||
{{svg "octicon-git-merge" 16 "text purple"}}
|
||||
{{else if and (.GetPullRequest ctx) (.GetPullRequest ctx).HasMerged}}
|
||||
{{svg "octicon-git-merge" 16 "text purple"}}
|
||||
{{if not .PullRequest}}
|
||||
No PullRequest
|
||||
{{else}}
|
||||
{{if .IsClosed}}
|
||||
{{svg "octicon-git-pull-request" 16 "text red"}}
|
||||
{{if .PullRequest.HasMerged}}
|
||||
{{svg "octicon-git-merge" 16 "text purple"}}
|
||||
{{else}}
|
||||
{{svg "octicon-git-pull-request" 16 "text red"}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{if and .PullRequest (.PullRequest.IsWorkInProgress ctx)}}
|
||||
{{svg "octicon-git-pull-request-draft" 16 "text grey"}}
|
||||
{{else if and (.GetPullRequest ctx) ((.GetPullRequest ctx).IsWorkInProgress ctx)}}
|
||||
{{if .PullRequest.IsWorkInProgress ctx}}
|
||||
{{svg "octicon-git-pull-request-draft" 16 "text grey"}}
|
||||
{{else}}
|
||||
{{svg "octicon-git-pull-request" 16 "text green"}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue