Fix template bugs in recently_pushed_new_branches.tmpl (#26744)

Fix some bugs from #25715, fix #25830

1. `$.locale.Tr ... Safe` needs `Escape`, but not `PathEscapeSegments`
2. The attribute should be `role`
3. The `ComposeBranchCompareURL` already does escaping correctly
This commit is contained in:
wxiaoguang 2023-08-27 08:16:02 +08:00 committed by GitHub
parent 4fdb09de58
commit 5914a2f8c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2,9 +2,9 @@
<div class="ui positive message gt-df gt-ac">
<div class="gt-f1">
{{$timeSince := TimeSince .CommitTime.AsTime $.locale}}
{{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (PathEscapeSegments .Name) $timeSince | Safe}}
{{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}}
</div>
<a aria-role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo (PathEscapeSegments .Name)}}">
<a role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo .Name}}">
{{$.locale.Tr "repo.pulls.compare_changes"}}
</a>
</div>