|
|
@ -214,6 +214,8 @@ func TagsList(ctx *context.Context) { |
|
|
|
ctx.Data["HideBranchesInDropdown"] = true |
|
|
|
ctx.Data["HideBranchesInDropdown"] = true |
|
|
|
ctx.Data["CanCreateRelease"] = ctx.Repo.CanWrite(unit.TypeReleases) && !ctx.Repo.Repository.IsArchived |
|
|
|
ctx.Data["CanCreateRelease"] = ctx.Repo.CanWrite(unit.TypeReleases) && !ctx.Repo.Repository.IsArchived |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namePattern := ctx.FormTrim("q") |
|
|
|
|
|
|
|
|
|
|
|
listOptions := db.ListOptions{ |
|
|
|
listOptions := db.ListOptions{ |
|
|
|
Page: ctx.FormInt("page"), |
|
|
|
Page: ctx.FormInt("page"), |
|
|
|
PageSize: ctx.FormInt("limit"), |
|
|
|
PageSize: ctx.FormInt("limit"), |
|
|
@ -233,6 +235,7 @@ func TagsList(ctx *context.Context) { |
|
|
|
IncludeTags: true, |
|
|
|
IncludeTags: true, |
|
|
|
HasSha1: optional.Some(true), |
|
|
|
HasSha1: optional.Some(true), |
|
|
|
RepoID: ctx.Repo.Repository.ID, |
|
|
|
RepoID: ctx.Repo.Repository.ID, |
|
|
|
|
|
|
|
NamePattern: optional.Some(namePattern), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
releases, err := db.Find[repo_model.Release](ctx, opts) |
|
|
|
releases, err := db.Find[repo_model.Release](ctx, opts) |
|
|
@ -241,14 +244,21 @@ func TagsList(ctx *context.Context) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
count, err := db.Count[repo_model.Release](ctx, opts) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
ctx.ServerError("GetReleasesByRepoID", err) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["Keyword"] = namePattern |
|
|
|
ctx.Data["Releases"] = releases |
|
|
|
ctx.Data["Releases"] = releases |
|
|
|
|
|
|
|
ctx.Data["TagCount"] = count |
|
|
|
|
|
|
|
|
|
|
|
numTags := ctx.Data["NumTags"].(int64) |
|
|
|
pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5) |
|
|
|
pager := context.NewPagination(int(numTags), opts.PageSize, opts.Page, 5) |
|
|
|
|
|
|
|
pager.SetDefaultParams(ctx) |
|
|
|
pager.SetDefaultParams(ctx) |
|
|
|
ctx.Data["Page"] = pager |
|
|
|
ctx.Data["Page"] = pager |
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["PageIsViewCode"] = !ctx.Repo.Repository.UnitEnabled(ctx, unit.TypeReleases) |
|
|
|
ctx.Data["PageIsViewCode"] = !ctx.Repo.Repository.UnitEnabled(ctx, unit.TypeReleases) |
|
|
|
|
|
|
|
|
|
|
|
ctx.HTML(http.StatusOK, tplTagsList) |
|
|
|
ctx.HTML(http.StatusOK, tplTagsList) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|