File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2769,6 +2769,8 @@ branch.new_branch_from = Create new branch from "%s"
2769
2769
branch.renamed = Branch %s was renamed to %s.
2770
2770
branch.rename_default_or_protected_branch_error = Only admins can rename default or protected branches.
2771
2771
branch.rename_protected_branch_failed = This branch is protected by glob-based protection rules.
2772
+ branch.commits_divergence_from = Commits divergence: %[1]d behind and %[2]d ahead of %[3]s
2773
+ branch.commits_no_divergence = The same as branch %[1]s
2772
2774
2773
2775
tag.create_tag = Create tag %s
2774
2776
tag.create_tag_operation = Create tag
Original file line number Diff line number Diff line change 107
107
{{end}}
108
108
</td>
109
109
<td class="two wide ui">
110
- {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
111
- <div class="commit-divergence">
110
+ {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
111
+ {{$tooltipDivergence := ""}}
112
+ {{if or .CommitsBehind .CommitsAhead}}
113
+ {{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_divergence_from" .CommitsBehind .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}
114
+ {{else}}
115
+ {{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_no_divergence" $.DefaultBranchBranch.DBBranch.Name}}
116
+ {{end}}
117
+ <div class="commit-divergence" data-tooltip-content="{{$tooltipDivergence}}">
112
118
<div class="bar-group">
113
119
<div class="count count-behind">{{.CommitsBehind}}</div>
114
120
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
119
125
<div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
120
126
</div>
121
127
</div>
122
- {{end}}
128
+ {{end}}
123
129
</td>
124
130
<td class="two wide tw-text-right">
125
131
{{if not .LatestPullRequest}}
You can’t perform that action at this time.
0 commit comments