File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ type Repository struct {
193
193
NumMilestones int `xorm:"NOT NULL DEFAULT 0"`
194
194
NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"`
195
195
NumOpenMilestones int `xorm:"-"`
196
- NumTags int `xorm:"-"`
196
+ NumReleases int `xorm:"-"`
197
197
198
198
IsPrivate bool `xorm:"INDEX"`
199
199
IsBare bool `xorm:"INDEX"`
Original file line number Diff line number Diff line change @@ -275,7 +275,15 @@ func RepoAssignment() macaron.Handler {
275
275
return
276
276
}
277
277
ctx .Data ["Tags" ] = tags
278
- ctx .Repo .Repository .NumTags = len (tags )
278
+
279
+ count , err := models .GetReleaseCountByRepoID (ctx .Repo .Repository .ID , models.FindReleasesOptions {
280
+ IncludeDrafts : false ,
281
+ })
282
+ if err != nil {
283
+ ctx .Handle (500 , "GetReleaseCountByRepoID" , err )
284
+ return
285
+ }
286
+ ctx .Repo .Repository .NumReleases = int (count )
279
287
280
288
ctx .Data ["Title" ] = owner .Name + "/" + repo .Name
281
289
ctx .Data ["Repository" ] = repo
Original file line number Diff line number Diff line change 81
81
82
82
{{if and (.Repository.UnitEnabled $.UnitTypeReleases) (not .IsBareRepo) }}
83
83
<a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
84
- <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumTags }}gray{{else}}blue{{end}} small label">{{.Repository.NumTags }}</span>
84
+ <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumReleases }}gray{{else}}blue{{end}} small label">{{.Repository.NumReleases }}</span>
85
85
</a>
86
86
{{end}}
87
87
You can’t perform that action at this time.
0 commit comments