follow 26257

This commit is contained in:
yp05327 2023-08-15 00:50:58 +00:00
parent a641d84bb1
commit 2e93f87122
2 changed files with 3 additions and 3 deletions

View File

@ -404,7 +404,7 @@ type FindRecentlyPushedNewBranchesOptions struct {
type RecentlyPushedNewBranch struct {
BranchName string
BranchCompareURL string
UpdatedUnix timeutil.TimeStamp
CommitTime timeutil.TimeStamp
}
// FindRecentlyPushedNewBranches return at most 2 new branches pushed by the user in 6 hours which has no opened PRs created
@ -485,7 +485,7 @@ func FindRecentlyPushedNewBranches(ctx context.Context, opts *FindRecentlyPushed
newBranches = append(newBranches, &RecentlyPushedNewBranch{
BranchName: branchName,
BranchCompareURL: branch.Repo.ComposeBranchCompareURL(opts.BaseRepo, branch.Name),
UpdatedUnix: branch.UpdatedUnix,
CommitTime: branch.CommitTime,
})
}
return newBranches, nil

View File

@ -2,7 +2,7 @@
<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" .BranchName $timeSince | Safe}}
</div>
<a aria-role="button" class="ui compact positive button gt-m-0" href="{{.BranchCompareURL}}">
{{$.locale.Tr "repo.pulls.compare_changes"}}