diff --git a/routers/web/repo/issue_new.go b/routers/web/repo/issue_new.go index b6422900cb..57786dd7d7 100644 --- a/routers/web/repo/issue_new.go +++ b/routers/web/repo/issue_new.go @@ -146,6 +146,7 @@ func NewIssue(ctx *context.Context) { } ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.Permission.CanWrite(unit.TypeIssues) + ctx.Data["IsIssuePoster"] = true // the current user will be the poster of the new issue if !issueConfig.BlankIssuesEnabled && hasTemplates && !templateLoaded { // The "issues/new" and "issues/new/choose" share the same query parameters "project" and "milestone", if blank issues are disabled, just redirect to the "issues/choose" page with these parameters. diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl index 2f3e792d64..7d2dcfd9f7 100644 --- a/templates/repo/issue/branch_selector_field.tmpl +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -14,14 +14,15 @@ Still needs to figure out: * Is "GitHub-like development sidebar (`#31899`)" good enough (or better) for your usage? */}} {{if and (not .Issue.IsPull) (not .PageIsComparePull)}} +{{$canChangeRef := or .IsIssuePoster .HasIssuesOrPullsWritePermission}} -