diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index c6d8c45af..dbc190928 100644 --- a/routers/web/repo/release.go +++ b/routers/web/repo/release.go @@ -185,6 +185,11 @@ func Releases(ctx *context.Context) { ctx.ServerError("getReleaseInfos", err) return } + for _, rel := range releases { + if rel.Release.IsTag && rel.Release.Title == "" { + rel.Release.Title = rel.Release.TagName + } + } ctx.Data["Releases"] = releases @@ -283,6 +288,7 @@ func SingleRelease(ctx *context.Context) { TagNames: []string{ctx.Params("*")}, // only show draft releases for users who can write, read-only users shouldn't see draft releases. IncludeDrafts: writeAccess, + IncludeTags: true, }) if err != nil { ctx.ServerError("getReleaseInfos", err) @@ -294,6 +300,9 @@ func SingleRelease(ctx *context.Context) { } release := releases[0].Release + if release.IsTag && release.Title == "" { + release.Title = release.TagName + } ctx.Data["PageIsSingleTag"] = release.IsTag if release.IsTag { diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 7f38fa3ff..873cccab7 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -18,18 +18,18 @@