From ed454f21039fda2711a809c6551c94dbcbd62c92 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Tue, 22 Mar 2022 14:26:56 +0000 Subject: [PATCH 1/4] Use the new/choose link for New Issue on project page Extend issues/new/choose to pass the project id and change New Issue link on project page to use new/choose Fix #19170 Signed-off-by: Andrew Thornton --- templates/repo/issue/choose.tmpl | 4 ++-- templates/repo/projects/view.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl index 0cec1ef63cbbe..7b4f64f04209d 100644 --- a/templates/repo/issue/choose.tmpl +++ b/templates/repo/issue/choose.tmpl @@ -14,7 +14,7 @@
{{.About | RenderEmojiPlain}} @@ -26,7 +26,7 @@
{{.i18n.Tr "repo.issues.choose.blank_about"}} diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index e96b92fb77b57..4ca21cc38eeb1 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -8,7 +8,7 @@
{{if and .CanWriteProjects (not .Repository.IsArchived)}} - {{.i18n.Tr "repo.issues.new"}} + {{.i18n.Tr "repo.issues.new"}} {{.i18n.Tr "new_project_board"}} {{end}}
From 3c9fe8c3983145b430e351e05f448b31c42472a7 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 23 Mar 2022 01:35:00 +0800 Subject: [PATCH 4/4] Add more comments about the redirection from choose to new --- routers/web/repo/issue.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 3a164f1e87079..2a5fb660f9118 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -848,6 +848,7 @@ func NewIssueChooseTemplate(ctx *context.Context) { ctx.Data["IssueTemplates"] = issueTemplates if len(issueTemplates) == 0 { + // The "issues/new" and "issues/new/choose" share the same query parameters "project" and "milestone", if no template here, just redirect to the "issues/new" page with these parameters. ctx.Redirect(fmt.Sprintf("%s/issues/new?%s", ctx.Repo.Repository.HTMLURL(), ctx.Req.URL.RawQuery), http.StatusSeeOther) return }