aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-03-21 21:13:08 +0800
committerGitHub <noreply@github.com>2024-03-21 14:13:08 +0100
commit62f8174aa2fae1481c7e17a6afcb731a5b178cd0 (patch)
treef94686ea110e943418a25534e0306f45169c9f48 /templates
parent01500957c29f6bfa2396b8457dbb0645edaafa99 (diff)
downloadgitea-62f8174aa2fae1481c7e17a6afcb731a5b178cd0.tar.gz
gitea-62f8174aa2fae1481c7e17a6afcb731a5b178cd0.zip
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>
Diffstat (limited to 'templates')
-rw-r--r--templates/shared/issueicon.tmpl16
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/shared/issueicon.tmpl b/templates/shared/issueicon.tmpl
index 089e80bd8b..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 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"}}