|
|
@ -117,9 +117,17 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { |
|
|
|
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived |
|
|
|
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived |
|
|
|
|
|
|
|
|
|
|
|
opts := repo_model.FindReleasesOptions{ |
|
|
|
opts := repo_model.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 := repo_model.GetReleasesByRepoID(ctx.Repo.Repository.ID, opts) |
|
|
|
releases, err := repo_model.GetReleasesByRepoID(ctx.Repo.Repository.ID, opts) |
|
|
|