aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-07-05 12:11:42 +0800
committerGitHub <noreply@github.com>2023-07-05 04:11:42 +0000
commit90b3b3dbf83dd88aab00d35535fe913b8d313bfb (patch)
tree0ef1cfd6c9fdffd7bce42e2c3f4e9e3e0bf752bf
parente7495735d5694cc32348bc674f3b9c63c1318e2c (diff)
downloadgitea-90b3b3dbf83dd88aab00d35535fe913b8d313bfb.tar.gz
gitea-90b3b3dbf83dd88aab00d35535fe913b8d313bfb.zip
Fix tags header and pretty format numbers (#25624)
This caused by #23465
-rw-r--r--routers/web/repo/release.go1
-rw-r--r--templates/repo/header.tmpl2
-rw-r--r--templates/repo/release_tag_header.tmpl4
-rw-r--r--templates/repo/sub_menu.tmpl4
4 files changed, 6 insertions, 5 deletions
diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go
index 32438a14da..c9f12a0f18 100644
--- a/routers/web/repo/release.go
+++ b/routers/web/repo/release.go
@@ -203,6 +203,7 @@ func releasesOrTags(ctx *context.Context, isTagList bool) {
ctx.Data["Page"] = pager
if isTagList {
+ ctx.Data["PageIsViewCode"] = !ctx.Repo.Repository.UnitEnabled(ctx, unit.TypeReleases)
ctx.HTML(http.StatusOK, tplTagsList)
} else {
ctx.HTML(http.StatusOK, tplReleasesList)
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 18ed738a20..aeb1e6a90e 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -207,7 +207,7 @@
{{end}}
{{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"}}
{{if .NumReleases}}
<span class="ui small label">{{CountFmt .NumReleases}}</span>
diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl
index fc1fafdefa..9938b9683e 100644
--- a/templates/repo/release_tag_header.tmpl
+++ b/templates/repo/release_tag_header.tmpl
@@ -5,9 +5,9 @@
<div class="gt-df">
<div class="gt-f1 gt-df gt-ac">
<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}}
- <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}}
</h2>
{{if .EnableFeed}}
diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl
index fbff7cfd29..27b707d332 100644
--- a/templates/repo/sub_menu.tmpl
+++ b/templates/repo/sub_menu.tmpl
@@ -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>
</div>
<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>
{{if $.Permission.CanRead $.UnitTypeCode}}
<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>
{{end}}
<div class="item" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>