diff options
author | Pedro Alves <pta2002@users.noreply.github.com> | 2020-10-25 21:49:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-25 17:49:48 -0400 |
commit | c40df54e28fe1a1cfd0fc5f834451996d96028f3 (patch) | |
tree | c4337b06fe24f70b385dd6b7e1198f2d4c26de9b /templates/repo/issue/view_content/comments.tmpl | |
parent | 756c090dbef0f4a1caffe8292780eea6c1d24c77 (diff) | |
download | gitea-c40df54e28fe1a1cfd0fc5f834451996d96028f3.tar.gz gitea-c40df54e28fe1a1cfd0fc5f834451996d96028f3.zip |
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 <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/repo/issue/view_content/comments.tmpl')
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 10 |
1 files changed, 8 insertions, 2 deletions
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 @@ </div> </div> {{else if eq .Type 7}} - {{if .Label}} + {{if or .AddedLabels .RemovedLabels}} <div class="timeline-item event" id="{{.HashTag}}"> <span class="badge">{{svg "octicon-tag"}}</span> <a class="ui avatar image" href="{{.Poster.HomeLink}}"> @@ -169,7 +169,13 @@ </a> <span class="text grey"> <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> - {{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}} </span> </div> {{end}} |