diff options
author | silverwind <me@silverwind.io> | 2020-10-24 13:54:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-24 14:54:33 +0300 |
commit | a69e11209d8f43f22ddac2dbfa6f1e7a87eba20f (patch) | |
tree | c8133fbd1f7aee4660a809aa414dfb7e9051e4bd /templates | |
parent | 0800c7e91dfb7e4128da0fdbd5601db4e2c13a0c (diff) | |
download | gitea-a69e11209d8f43f22ddac2dbfa6f1e7a87eba20f.tar.gz gitea-a69e11209d8f43f22ddac2dbfa6f1e7a87eba20f.zip |
Don't show "0" labels on repo tabs (#13289)
If count is zero, don't show the label, matching GH behavior.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/header.tmpl | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index ae32c3fed5..77f2362f8e 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -83,7 +83,10 @@ {{if .Permission.CanRead $.UnitTypeIssues}} <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues"> - {{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{CountFmt .Repository.NumOpenIssues}}</span> + {{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}} + {{if .Repository.NumOpenIssues}} + <span class="ui blue small label">{{CountFmt .Repository.NumOpenIssues}}</span> + {{end}} </a> {{end}} @@ -95,22 +98,28 @@ {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}} <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls"> - {{svg "octicon-git-pull-request"}} {{.i18n.Tr "repo.pulls"}} <span class="ui {{if not .Repository.NumOpenPulls}}gray{{else}}blue{{end}} small label">{{CountFmt .Repository.NumOpenPulls}}</span> + {{svg "octicon-git-pull-request"}} {{.i18n.Tr "repo.pulls"}} + {{if .Repository.NumOpenPulls}} + <span class="ui blue small label">{{CountFmt .Repository.NumOpenPulls}}</span> + {{end}} </a> {{end}} {{ if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}} <a href="{{.RepoLink}}/projects" class="{{ if .IsProjectsPage }}active{{end}} item"> {{svg "octicon-project"}} {{.i18n.Tr "repo.project_board"}} - <span class="ui {{if not .Repository.NumOpenProjects}}gray{{else}}blue{{end}} small label"> - {{CountFmt .Repository.NumOpenProjects}} - </span> + {{if .Repository.NumOpenProjects}} + <span class="ui blue small label">{{CountFmt .Repository.NumOpenProjects}}</span> + {{end}} </a> {{ end }} {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }} <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases"> - {{svg "octicon-tag"}} {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .NumReleases}}gray{{else}}blue{{end}} small label">{{CountFmt .NumReleases}}</span> + {{svg "octicon-tag"}} {{.i18n.Tr "repo.releases"}} + {{if .NumReleases}} + <span class="ui blue small label">{{CountFmt .NumReleases}}</span> + {{end}} </a> {{end}} |