diff options
author | Zsombor <gzsombor@users.noreply.github.com> | 2017-08-24 14:30:27 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-08-24 15:30:27 +0300 |
commit | da230a287264d38156e950a3149e43f65599e65b (patch) | |
tree | 4c5f4d16186f2d201515f77fdf99e9d3fc90df95 /routers | |
parent | 174255e74ee2c07e685913ab8bce08fc046569f0 (diff) | |
download | gitea-da230a287264d38156e950a3149e43f65599e65b.tar.gz gitea-da230a287264d38156e950a3149e43f65599e65b.zip |
Add possibility to record branch or tag information in an issue (#780)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index e4ed10d980..d1c5e1fe71 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -292,6 +292,13 @@ func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository) []*models. return nil } + brs, err := ctx.Repo.GitRepo.GetBranches() + if err != nil { + ctx.Handle(500, "GetBranches", err) + return nil + } + ctx.Data["Branches"] = brs + return labels } @@ -418,6 +425,7 @@ func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) { ctx.Data["PageIsIssueList"] = true ctx.Data["RequireHighlightJS"] = true ctx.Data["RequireSimpleMDE"] = true + ctx.Data["ReadOnly"] = false renderAttachmentSettings(ctx) var ( @@ -447,6 +455,7 @@ func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm) { MilestoneID: milestoneID, AssigneeID: assigneeID, Content: form.Content, + Ref: form.Ref, } if err := models.NewIssue(repo, issue, labelIDs, attachments); err != nil { ctx.Handle(500, "NewIssue", err) @@ -668,6 +677,7 @@ func ViewIssue(ctx *context.Context) { ctx.Data["Participants"] = participants ctx.Data["NumParticipants"] = len(participants) ctx.Data["Issue"] = issue + ctx.Data["ReadOnly"] = true ctx.Data["IsIssueOwner"] = ctx.Repo.IsWriter() || (ctx.IsSigned && issue.IsPoster(ctx.User.ID)) ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + ctx.Data["Link"].(string) ctx.HTML(200, tplIssueView) |