Skip to content

Commit eb2f73b

Browse files
committed
rm repo.NumReleases
1 parent 9395706 commit eb2f73b

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

models/repo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ type Repository struct {
166166
NumMilestones int `xorm:"NOT NULL DEFAULT 0"`
167167
NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"`
168168
NumOpenMilestones int `xorm:"-"`
169-
NumReleases int `xorm:"-"`
170169

171170
IsPrivate bool `xorm:"INDEX"`
172171
IsEmpty bool `xorm:"INDEX"`

modules/context/repo.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,14 @@ func RepoAssignment() macaron.Handler {
439439
ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL
440440
}
441441

442-
count, err := models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
442+
ctx.Data["NumReleases"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
443443
IncludeDrafts: false,
444444
IncludeTags: true,
445445
})
446446
if err != nil {
447447
ctx.ServerError("GetReleaseCountByRepoID", err)
448448
return
449449
}
450-
ctx.Repo.Repository.NumReleases = int(count)
451450

452451
ctx.Data["Title"] = owner.Name + "/" + repo.Name
453452
ctx.Data["Repository"] = repo

templates/repo/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117

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

0 commit comments

Comments
 (0)