File tree Expand file tree Collapse file tree 3 files changed +2
-4
lines changed Expand file tree Collapse file tree 3 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ type Repository struct {
166
166
NumMilestones int `xorm:"NOT NULL DEFAULT 0"`
167
167
NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"`
168
168
NumOpenMilestones int `xorm:"-"`
169
- NumReleases int `xorm:"-"`
170
169
171
170
IsPrivate bool `xorm:"INDEX"`
172
171
IsEmpty bool `xorm:"INDEX"`
Original file line number Diff line number Diff line change @@ -439,15 +439,14 @@ func RepoAssignment() macaron.Handler {
439
439
ctx .Data ["RepoExternalIssuesLink" ] = unit .ExternalTrackerConfig ().ExternalTrackerURL
440
440
}
441
441
442
- count , err : = models .GetReleaseCountByRepoID (ctx .Repo .Repository .ID , models.FindReleasesOptions {
442
+ ctx . Data [ "NumReleases" ] , err = models .GetReleaseCountByRepoID (ctx .Repo .Repository .ID , models.FindReleasesOptions {
443
443
IncludeDrafts : false ,
444
444
IncludeTags : true ,
445
445
})
446
446
if err != nil {
447
447
ctx .ServerError ("GetReleaseCountByRepoID" , err )
448
448
return
449
449
}
450
- ctx .Repo .Repository .NumReleases = int (count )
451
450
452
451
ctx .Data ["Title" ] = owner .Name + "/" + repo .Name
453
452
ctx .Data ["Repository" ] = repo
Original file line number Diff line number Diff line change 117
117
118
118
{{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }}
119
119
<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>
121
121
</a>
122
122
{{end}}
123
123
You can’t perform that action at this time.
0 commit comments