From 04eea29ecbfed76ae693dab441adf5415b2e2f64 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 5 Jul 2023 03:08:16 -0400 Subject: [PATCH] Fix tags header and pretty format numbers (#25624) (#25694) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport #25624 by @lunny This casused by #23465 Before release disabled 图片 release enabled 图片 After release disabled 图片 release enabled 图片 Co-authored-by: Lunny Xiao --- routers/web/repo/release.go | 1 + templates/repo/header.tmpl | 2 +- templates/repo/release_tag_header.tmpl | 4 ++-- templates/repo/sub_menu.tmpl | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index 0950e6856..0b927a3a2 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 33791fd51..b55e83a9d 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -207,7 +207,7 @@ {{end}} {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo)}} - + {{svg "octicon-tag"}} {{.locale.Tr "repo.releases"}} {{if .NumReleases}} {{CountFmt .NumReleases}} diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl index 0af9ba863..7129e4235 100644 --- a/templates/repo/release_tag_header.tmpl +++ b/templates/repo/release_tag_header.tmpl @@ -5,9 +5,9 @@