From 5e047b9bd7ba4bfa1c1ae3683eabe7e290de5728 Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Mon, 3 May 2021 13:27:48 -0400 Subject: Add compare tag dropdown to releases page (#15695) * Add compare tag dropdown to releases page * Change defaults to be more intuitive and remove unneeded option * Fix to select branch on releases page Co-authored-by: Jonathan Tran Co-authored-by: Kyle D --- routers/repo/release.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'routers') diff --git a/routers/repo/release.go b/routers/repo/release.go index abce3e9ac1..6b0b92743d 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -70,6 +70,11 @@ func TagsList(ctx *context.Context) { func releasesOrTags(ctx *context.Context, isTagList bool) { ctx.Data["PageIsReleaseList"] = true ctx.Data["DefaultBranch"] = ctx.Repo.Repository.DefaultBranch + ctx.Data["IsViewBranch"] = false + ctx.Data["IsViewTag"] = true + // Disable the showCreateNewBranch form in the dropdown on this page. + ctx.Data["CanCreateBranch"] = false + ctx.Data["HideBranchesInDropdown"] = true if isTagList { ctx.Data["Title"] = ctx.Tr("repo.release.tags") @@ -79,6 +84,13 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { ctx.Data["PageIsTagList"] = false } + tags, err := ctx.Repo.GitRepo.GetTags() + if err != nil { + ctx.ServerError("GetTags", err) + return + } + ctx.Data["Tags"] = tags + writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases) ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived -- cgit v1.2.3