Fix release counter on API repository info (#10968)

Use the same mechanism as the webpage for calculating the release count

Fix #10946
This commit is contained in:
6543
2020-04-06 20:42:30 +02:00
committed by GitHub
parent ef89e75d0e
commit ad31d6b5e8
4 changed files with 25 additions and 7 deletions

View File

@ -117,7 +117,7 @@
{{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }}
<a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
{{svg "octicon-tag" 16}} {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumReleases}}gray{{else}}blue{{end}} small label">{{.Repository.NumReleases}}</span>
{{svg "octicon-tag" 16}} {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .NumReleases}}gray{{else}}blue{{end}} small label">{{.NumReleases}}</span>
</a>
{{end}}