File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -803,6 +803,9 @@ func NewIssue(ctx *context.Context) {
803803 ctx .Data ["Project" ] = project
804804 }
805805
806+ if len (ctx .Req .URL .Query ().Get ("project" )) > 0 {
807+ ctx .Data ["redirect_after_creation" ] = "project"
808+ }
806809 }
807810
808811 RetrieveRepoMetas (ctx , ctx .Repo .Repository , false )
@@ -990,7 +993,11 @@ func NewIssuePost(ctx *context.Context) {
990993 }
991994
992995 log .Trace ("Issue created: %d/%d" , repo .ID , issue .ID )
993- ctx .Redirect (ctx .Repo .RepoLink + "/issues/" + fmt .Sprint (issue .Index ))
996+ if ctx .FormString ("redirect_after_creation" ) == "project" {
997+ ctx .Redirect (ctx .Repo .RepoLink + "/projects/" + fmt .Sprint (form .ProjectID ))
998+ } else {
999+ ctx .Redirect (ctx .Repo .RepoLink + "/issues/" + fmt .Sprint (issue .Index ))
1000+ }
9941001}
9951002
9961003// 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 236236 {{end}}
237237 </div>
238238 </div>
239+ <input type="hidden" name="redirect_after_creation" value="{{.redirect_after_creation}}">
239240 </div>
240241</form>
You can’t perform that action at this time.
0 commit comments