Fix tags header and pretty format numbers (#25624)

This caused by #23465
This commit is contained in:
Lunny Xiao 2023-07-05 12:11:42 +08:00 committed by GitHub
parent e7495735d5
commit 90b3b3dbf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -203,6 +203,7 @@ func releasesOrTags(ctx *context.Context, isTagList bool) {
ctx.Data["Page"] = pager ctx.Data["Page"] = pager
if isTagList { if isTagList {
ctx.Data["PageIsViewCode"] = !ctx.Repo.Repository.UnitEnabled(ctx, unit.TypeReleases)
ctx.HTML(http.StatusOK, tplTagsList) ctx.HTML(http.StatusOK, tplTagsList)
} else { } else {
ctx.HTML(http.StatusOK, tplReleasesList) ctx.HTML(http.StatusOK, tplReleasesList)

View File

@ -207,7 +207,7 @@
{{end}} {{end}}
{{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}} {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}}
<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases"> <a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases">
{{svg "octicon-tag"}} {{.locale.Tr "repo.releases"}} {{svg "octicon-tag"}} {{.locale.Tr "repo.releases"}}
{{if .NumReleases}} {{if .NumReleases}}
<span class="ui small label">{{CountFmt .NumReleases}}</span> <span class="ui small label">{{CountFmt .NumReleases}}</span>

View File

@ -5,9 +5,9 @@
<div class="gt-df"> <div class="gt-df">
<div class="gt-f1 gt-df gt-ac"> <div class="gt-f1 gt-df gt-ac">
<h2 class="ui compact small menu header small-menu-items"> <h2 class="ui compact small menu header small-menu-items">
<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.Tr "repo.release.releases"}}</a> <a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.PrettyNumber .ReleasesNum}} {{.locale.TrN .ReleasesNum "repo.release" "repo.releases"}}</a>
{{if $canReadCode}} {{if $canReadCode}}
<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.Tr "repo.release.tags"}}</a> <a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
{{end}} {{end}}
</h2> </h2>
{{if .EnableFeed}} {{if .EnableFeed}}

View File

@ -7,11 +7,11 @@
<a href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">{{svg "octicon-history"}} <b>{{.locale.PrettyNumber .CommitsCount}}</b> {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}</a> <a href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">{{svg "octicon-history"}} <b>{{.locale.PrettyNumber .CommitsCount}}</b> {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}</a>
</div> </div>
<div class="item{{if .PageIsBranches}} active{{end}}"> <div class="item{{if .PageIsBranches}} active{{end}}">
<a href="{{.RepoLink}}/branches">{{svg "octicon-git-branch"}} <b>{{.BranchesCount}}</b> {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}}</a> <a href="{{.RepoLink}}/branches">{{svg "octicon-git-branch"}} <b>{{.locale.PrettyNumber .BranchesCount}}</b> {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}}</a>
</div> </div>
{{if $.Permission.CanRead $.UnitTypeCode}} {{if $.Permission.CanRead $.UnitTypeCode}}
<div class="item{{if .PageIsTagList}} active{{end}}"> <div class="item{{if .PageIsTagList}} active{{end}}">
<a href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.NumTags}}</b> {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a> <a href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.locale.PrettyNumber .NumTags}}</b> {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
</div> </div>
{{end}} {{end}}
<div class="item" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}> <div class="item" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>