aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorJonathan Tran <jonnytran@gmail.com>2021-05-03 13:27:48 -0400
committerGitHub <noreply@github.com>2021-05-03 13:27:48 -0400
commit5e047b9bd7ba4bfa1c1ae3683eabe7e290de5728 (patch)
tree4f677454d6184de0ba06fed197a478ec6ce8dfe7 /routers
parent1b017fe7ca9df5a8c7d7823a1ded897fc324f9d3 (diff)
downloadgitea-5e047b9bd7ba4bfa1c1ae3683eabe7e290de5728.tar.gz
gitea-5e047b9bd7ba4bfa1c1ae3683eabe7e290de5728.zip
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 <jon@allspice.io> Co-authored-by: Kyle D <kdumontnu@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/release.go12
1 files changed, 12 insertions, 0 deletions
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