-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Redirect on project after issue created #17211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
1aaa769
0af4e42
34a7201
6849c8c
43b3ad9
11696b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -803,6 +803,9 @@ func NewIssue(ctx *context.Context) { | |
| ctx.Data["Project"] = project | ||
| } | ||
|
|
||
| if len(ctx.Req.URL.Query().Get("project")) > 0 { | ||
| ctx.Data["redirect_on_project"] = true | ||
| } | ||
| } | ||
|
|
||
| RetrieveRepoMetas(ctx, ctx.Repo.Repository, false) | ||
|
|
@@ -990,7 +993,11 @@ func NewIssuePost(ctx *context.Context) { | |
| } | ||
|
|
||
| log.Trace("Issue created: %d/%d", repo.ID, issue.ID) | ||
| ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + fmt.Sprint(issue.Index)) | ||
| if ctx.FormBool("redirect_on_project") { | ||
|
||
| ctx.Redirect(ctx.Repo.RepoLink + "/projects/" + fmt.Sprint(form.ProjectID)) | ||
| } else { | ||
| ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + fmt.Sprint(issue.Index)) | ||
| } | ||
| } | ||
|
|
||
| // commentTag returns the CommentTag for a comment in/with the given repo, poster and issue | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,5 +236,6 @@ | |
| {{end}} | ||
| </div> | ||
| </div> | ||
| <input type="hidden" name="redirect_on_project" value="{{.redirect_on_project}}"> | ||
|
||
| </div> | ||
| </form> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this is unnecessary? The POST requests will also request the current URL. So that the query strings are still there.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue edit form's
actionis filled by{{.Link}}, without query string. So this parameter is necessary.