Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2769,6 +2769,10 @@ branch.new_branch_from = Create new branch from "%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_protected_branch_failed = This branch is protected by glob-based protection rules.
branch.commits_ahead_1 = %d commit ahead of %s
branch.commits_ahead_n = %d commits ahead of %s
branch.commits_behind_1 = %d commit behind %s
branch.commits_behind_n = %d commits behind %s

tag.create_tag = Create tag %s
tag.create_tag_operation = Create tag
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/branch/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
<div class="commit-divergence">
<div class="bar-group">
<div class="count count-behind">{{.CommitsBehind}}</div>
<div class="count count-behind" data-tooltip-content="{{if eq .CommitsBehind 1}}{{ctx.Locale.Tr "repo.branch.commits_behind_1" .CommitsBehind $.DefaultBranchBranch.DBBranch.Name}}{{else}}{{ctx.Locale.Tr "repo.branch.commits_behind_n" .CommitsBehind $.DefaultBranchBranch.DBBranch.Name}}{{end}}">{{.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. */}}
<div class="bar bar-behind" style="width: {{Eval 100 "*" .CommitsBehind "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
</div>
<div class="bar-group">
<div class="count count-ahead">{{.CommitsAhead}}</div>
<div class="count count-ahead" data-tooltip-content="{{if eq .CommitsAhead 1}}{{ctx.Locale.Tr "repo.branch.commits_ahead_1" .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}{{else}}{{ctx.Locale.Tr "repo.branch.commits_ahead_n" .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}{{end}}">{{.CommitsAhead}}</div>
<div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
</div>
</div>
Expand Down