diff options
author | Giteabot <teabot@gitea.io> | 2023-07-05 03:08:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 07:08:16 +0000 |
commit | 04eea29ecbfed76ae693dab441adf5415b2e2f64 (patch) | |
tree | 22d6bb5ee81ff0ba18dddb5387cc9d58ff86dda7 /templates/repo | |
parent | 511be9fe6e06ece964ce93daae49f02d7880c96e (diff) | |
download | gitea-04eea29ecbfed76ae693dab441adf5415b2e2f64.tar.gz gitea-04eea29ecbfed76ae693dab441adf5415b2e2f64.zip |
Fix tags header and pretty format numbers (#25624) (#25694)
Backport #25624 by @lunny
This casused by #23465
Before
release disabled
<img width="1320" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/190a1c81-daa5-41bc-91ac-c9a0bf629b5f">
release enabled
<img width="1320" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/a0372c31-727c-4ee0-a6b9-30e502498d90">
After
release disabled
<img width="1304" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/a747ea80-a3d9-4792-8f6d-e8955da78b9e">
release enabled
<img width="1290" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/7c0bc43a-9149-4148-859d-35839aeb60ca">
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/header.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/release_tag_header.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/sub_menu.tmpl | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 33791fd512..b55e83a9d3 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 0af9ba8635..7129e4235f 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 bfe5a20b16..6c09d8f436 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"> |