mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
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>
This commit is contained in:
parent
756c090dbe
commit
c40df54e28
5 changed files with 72 additions and 5 deletions
|
@ -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}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue