diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-03-22 09:58:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 09:58:04 +0800 |
commit | 6ef986d47452f36b101edc3cc9e3c41ad480eb09 (patch) | |
tree | a1e60a11e93d5696481a808fcbce07d4229951e4 /templates | |
parent | c03b1e28544ee60c72f9dc7d9f362753bb3d778c (diff) | |
download | gitea-6ef986d47452f36b101edc3cc9e3c41ad480eb09.tar.gz gitea-6ef986d47452f36b101edc3cc9e3c41ad480eb09.zip |
Performance improvements for pull request list page (#29900) (#29972)
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
Backport #29900
Diffstat (limited to 'templates')
-rw-r--r-- | templates/shared/issueicon.tmpl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/shared/issueicon.tmpl b/templates/shared/issueicon.tmpl index 94132825c4..a62714e988 100644 --- a/templates/shared/issueicon.tmpl +++ b/templates/shared/issueicon.tmpl @@ -1,15 +1,15 @@ {{if .IsPull}} - {{if and .PullRequest .PullRequest.HasMerged}} - {{svg "octicon-git-merge" 16 "text purple"}} - {{else if and .GetPullRequest .GetPullRequest.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 (.GetPullRequest.IsWorkInProgress ctx)}} + {{if .PullRequest.IsWorkInProgress ctx}} {{svg "octicon-git-pull-request-draft" 16 "text grey"}} {{else}} {{svg "octicon-git-pull-request" 16 "text green"}} |