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"
27692769branch.renamed = Branch %s was renamed to %s.
27702770branch.rename_default_or_protected_branch_error = Only admins can rename default or protected branches.
27712771branch.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
27722774
27732775tag.create_tag = Create tag %s
27742776tag.create_tag_operation = Create tag
Original file line number Diff line number Diff line change 107107 {{end}}
108108 </td>
109109 <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}}">
112118 <div class="bar-group">
113119 <div class="count count-behind">{{.CommitsBehind}}</div>
114120 {{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
119125 <div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
120126 </div>
121127 </div>
122- {{ end }}
128+ {{end}}
123129 </td>
124130 <td class="two wide tw-text-right">
125131 {{if not .LatestPullRequest}}
You can’t perform that action at this time.
0 commit comments