From da230a287264d38156e950a3149e43f65599e65b Mon Sep 17 00:00:00 2001 From: Zsombor Date: Thu, 24 Aug 2017 14:30:27 +0200 Subject: Add possibility to record branch or tag information in an issue (#780) --- routers/repo/issue.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'routers') 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) -- cgit v1.2.3