mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 18:23:19 +00:00
Adds tooltip on branch commit counts (#34869)
Adds a tooltip to the commit counts when comparing branches, making it easier for novice users to understand what the numbers mean. Fixes #34867. --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
90f96c301e
commit
35f0b5a3ec
@ -2769,6 +2769,8 @@ branch.new_branch_from = Create new branch from "%s"
|
|||||||
branch.renamed = Branch %s was renamed to %s.
|
branch.renamed = Branch %s was renamed to %s.
|
||||||
branch.rename_default_or_protected_branch_error = Only admins can rename default or protected branches.
|
branch.rename_default_or_protected_branch_error = Only admins can rename default or protected branches.
|
||||||
branch.rename_protected_branch_failed = This branch is protected by glob-based protection rules.
|
branch.rename_protected_branch_failed = This branch is protected by glob-based protection rules.
|
||||||
|
branch.commits_divergence_from = Commits divergence: %[1]d behind and %[2]d ahead of %[3]s
|
||||||
|
branch.commits_no_divergence = The same as branch %[1]s
|
||||||
|
|
||||||
tag.create_tag = Create tag %s
|
tag.create_tag = Create tag %s
|
||||||
tag.create_tag_operation = Create tag
|
tag.create_tag_operation = Create tag
|
||||||
|
@ -108,7 +108,13 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="two wide ui">
|
<td class="two wide ui">
|
||||||
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
|
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
|
||||||
<div class="commit-divergence">
|
{{$tooltipDivergence := ""}}
|
||||||
|
{{if or .CommitsBehind .CommitsAhead}}
|
||||||
|
{{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_divergence_from" .CommitsBehind .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}
|
||||||
|
{{else}}
|
||||||
|
{{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_no_divergence" $.DefaultBranchBranch.DBBranch.Name}}
|
||||||
|
{{end}}
|
||||||
|
<div class="commit-divergence" data-tooltip-content="{{$tooltipDivergence}}">
|
||||||
<div class="bar-group">
|
<div class="bar-group">
|
||||||
<div class="count count-behind">{{.CommitsBehind}}</div>
|
<div class="count count-behind">{{.CommitsBehind}}</div>
|
||||||
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
|
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
|
||||||
|
Loading…
Reference in New Issue
Block a user