|
|
@ -117,8 +117,16 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { |
|
|
|
|
|
|
|
|
|
|
|
opts := models.FindReleasesOptions{ |
|
|
|
opts := models.FindReleasesOptions{ |
|
|
|
ListOptions: listOptions, |
|
|
|
ListOptions: listOptions, |
|
|
|
IncludeDrafts: writeAccess && !isTagList, |
|
|
|
} |
|
|
|
IncludeTags: isTagList, |
|
|
|
if isTagList { |
|
|
|
|
|
|
|
// for the tags list page, show all releases with real tags (having real commit-id),
|
|
|
|
|
|
|
|
// the drafts should also be included because a real tag might be used as a draft.
|
|
|
|
|
|
|
|
opts.IncludeDrafts = true |
|
|
|
|
|
|
|
opts.IncludeTags = true |
|
|
|
|
|
|
|
opts.HasSha1 = util.OptionalBoolTrue |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// only show draft releases for users who can write, read-only users shouldn't see draft releases.
|
|
|
|
|
|
|
|
opts.IncludeDrafts = writeAccess |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
releases, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID, opts) |
|
|
|
releases, err := models.GetReleasesByRepoID(ctx.Repo.Repository.ID, opts) |
|
|
|