From 619aa59bc27bb9b8865a3c591854255c0a47550f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 2 Jul 2023 12:06:58 +0800 Subject: [PATCH 1/3] Fix tags header --- routers/web/repo/release.go | 1 + templates/repo/header.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index 5fddddb344080..ff994aacac732 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 18ed738a204f4..aeb1e6a90e62a 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}} From 6086a7a30990fe3fd9f70c2d33b8b72d8a60ddda Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 2 Jul 2023 16:04:02 +0800 Subject: [PATCH 2/3] pretty format --- templates/repo/sub_menu.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index fbff7cfd29126..27b707d33284a 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -7,11 +7,11 @@ {{svg "octicon-history"}} {{.locale.PrettyNumber .CommitsCount}} {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}
- {{svg "octicon-git-branch"}} {{.BranchesCount}} {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}} + {{svg "octicon-git-branch"}} {{.locale.PrettyNumber .BranchesCount}} {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}}
{{if $.Permission.CanRead $.UnitTypeCode}}
- {{svg "octicon-tag"}} {{.NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}} + {{svg "octicon-tag"}} {{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}
{{end}}
From 1504e92ced574d01188d1dd448ca8a8febfacb4b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 2 Jul 2023 16:15:21 +0800 Subject: [PATCH 3/3] Add number for releaes page --- templates/repo/release_tag_header.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/release_tag_header.tmpl b/templates/repo/release_tag_header.tmpl index fc1fafdefa5f8..9938b9683e42b 100644 --- a/templates/repo/release_tag_header.tmpl +++ b/templates/repo/release_tag_header.tmpl @@ -5,9 +5,9 @@