|
|
|
@ -83,7 +83,18 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { |
|
|
|
|
ctx.Data["PageIsTagList"] = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tags, err := ctx.Repo.GitRepo.GetTags() |
|
|
|
|
listOptions := models.ListOptions{ |
|
|
|
|
Page: ctx.FormInt("page"), |
|
|
|
|
PageSize: ctx.FormInt("limit"), |
|
|
|
|
} |
|
|
|
|
if listOptions.PageSize == 0 { |
|
|
|
|
listOptions.PageSize = setting.Repository.Release.DefaultPagingNum |
|
|
|
|
} |
|
|
|
|
if listOptions.PageSize > setting.API.MaxResponseItems { |
|
|
|
|
listOptions.PageSize = setting.API.MaxResponseItems |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tags, err := ctx.Repo.GitRepo.GetTags(listOptions.GetStartEnd()) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.ServerError("GetTags", err) |
|
|
|
|
return |
|
|
|
@ -92,19 +103,9 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { |
|
|
|
|
|
|
|
|
|
writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases) |
|
|
|
|
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived |
|
|
|
|
limit := ctx.FormInt("limit") |
|
|
|
|
if limit == 0 { |
|
|
|
|
limit = setting.Repository.Release.DefaultPagingNum |
|
|
|
|
} |
|
|
|
|
if limit > setting.API.MaxResponseItems { |
|
|
|
|
limit = setting.API.MaxResponseItems |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
opts := models.FindReleasesOptions{ |
|
|
|
|
ListOptions: models.ListOptions{ |
|
|
|
|
Page: ctx.FormInt("page"), |
|
|
|
|
PageSize: limit, |
|
|
|
|
}, |
|
|
|
|
ListOptions: listOptions, |
|
|
|
|
IncludeDrafts: writeAccess && !isTagList, |
|
|
|
|
IncludeTags: isTagList, |
|
|
|
|
} |
|
|
|
|