Tags cleanup (#13428)

* Tags cleanup

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
John Olheiser 2020-11-05 08:20:42 -06:00 committed by GitHub
parent 05efb33595
commit 7c68ac8f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -449,14 +449,18 @@ func RepoAssignment() macaron.Handler {
ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL
} }
ctx.Data["NumReleases"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{ ctx.Data["NumTags"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
IncludeDrafts: false, IncludeTags: true,
IncludeTags: true,
}) })
if err != nil { if err != nil {
ctx.ServerError("GetReleaseCountByRepoID", err) ctx.ServerError("GetReleaseCountByRepoID", err)
return return
} }
ctx.Data["NumReleases"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{})
if err != nil {
ctx.ServerError("GetReleaseCountByRepoID", err)
return
}
ctx.Data["Title"] = owner.Name + "/" + repo.Name ctx.Data["Title"] = owner.Name + "/" + repo.Name
ctx.Data["Repository"] = repo ctx.Data["Repository"] = repo

View File

@ -810,6 +810,7 @@ commits = Commits
commit = Commit commit = Commit
release = Release release = Release
releases = Releases releases = Releases
tag = Tag
released_this = released this released_this = released this
file_raw = Raw file_raw = Raw
file_history = History file_history = History

View File

@ -10,7 +10,7 @@
</div> </div>
{{if $.Permission.CanRead $.UnitTypeCode}} {{if $.Permission.CanRead $.UnitTypeCode}}
<div class="item"> <div class="item">
<a class="ui" href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.NumReleases}}</b> {{.i18n.Tr (TrN .i18n.Lang .NumReleases "repo.release" "repo.releases") }}</a> <a class="ui" href="{{.RepoLink}}/tags">{{svg "octicon-tag"}} <b>{{.NumTags}}</b> {{.i18n.Tr (TrN .i18n.Lang .NumTags "repo.tag" "repo.tags") }}</a>
</div> </div>
{{end}} {{end}}
<div class="item"> <div class="item">