From 4117a443c27cc5b8af75be32ed6949d028694eff Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 12 Nov 2020 06:55:34 +0100 Subject: [PATCH] Lazy-load issue reviewers and assignees avatars (#13526) The avatars inside the dropdowns were previously fetched every time a Pull Request was opened resulting in potential unnecessary downloads. This lazy-loads through the newish loading=lazy attribute. Also did a few minor adjustments on the file. --- .../repo/issue/view_content/sidebar.tmpl | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 4165ba49e6..dd4dadca51 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -26,7 +26,8 @@ {{svg "octicon-check"}} - {{.User.GetDisplayName}} + + {{.User.GetDisplayName}} {{end}} @@ -52,9 +53,12 @@ {{.i18n.Tr "repo.issues.new.no_reviewers"}}
{{range .PullReviewers}} -
+
{{if .User}} -  {{.User.GetDisplayName}} + + + {{.User.GetDisplayName}} + {{else if .Team}} {{svg "octicon-people" 16 "teamavatar"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}} {{end}} @@ -253,11 +257,7 @@ {{range .Assignees}} {{$AssigneeID := .ID}} - + {{$checked := false}} {{range $.Issue.Assignees}} {{if eq .ID $AssigneeID}} @@ -266,7 +266,8 @@ {{end}} {{svg "octicon-check"}} - {{.GetDisplayName}} + + {{.GetDisplayName}} {{end}} @@ -277,7 +278,10 @@
{{range .Issue.Assignees}} {{end}}