From c40df54e28fe1a1cfd0fc5f834451996d96028f3 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 25 Oct 2020 21:49:48 +0000 Subject: Group Label Changed Comments in timeline (#13304) * Create function to group label comments * Combine multiple label additions into one * Group removed and added labels in the same comment * Fix indentation on comments.tmpl Co-authored-by: zeripath Co-authored-by: zeripath --- templates/repo/issue/view_content/comments.tmpl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'templates/repo/issue/view_content/comments.tmpl') diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 68bb2d49f7..e37c7e7fdd 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -161,7 +161,7 @@ {{else if eq .Type 7}} - {{if .Label}} + {{if or .AddedLabels .RemovedLabels}}
{{svg "octicon-tag"}} @@ -169,7 +169,13 @@ {{.Poster.GetDisplayName}} - {{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|RenderEmoji) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|RenderEmoji) $createdStr | Safe}}{{end}} + {{if and .AddedLabels (not .RemovedLabels)}} + {{$.i18n.Tr (TrN $.i18n.Lang (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels") (RenderLabels .AddedLabels) $createdStr | Safe}} + {{else if and (not .AddedLabels) .RemovedLabels}} + {{$.i18n.Tr (TrN $.i18n.Lang (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels") (RenderLabels .RemovedLabels) $createdStr | Safe}} + {{else}} + {{$.i18n.Tr "repo.issues.add_remove_labels" (RenderLabels .AddedLabels) (RenderLabels .RemovedLabels) $createdStr | Safe}} + {{end}}
{{end}} -- cgit v1.2.3