File tree 2 files changed +9
-1
lines changed
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) {
803
803
ctx .Data ["Project" ] = project
804
804
}
805
805
806
+ if len (ctx .Req .URL .Query ().Get ("project" )) > 0 {
807
+ ctx .Data ["redirect_after_creation" ] = "project"
808
+ }
806
809
}
807
810
808
811
RetrieveRepoMetas (ctx , ctx .Repo .Repository , false )
@@ -990,7 +993,11 @@ func NewIssuePost(ctx *context.Context) {
990
993
}
991
994
992
995
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
+ }
994
1001
}
995
1002
996
1003
// 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
236
{{end}}
237
237
</div>
238
238
</div>
239
+ <input type="hidden" name="redirect_after_creation" value="{{.redirect_after_creation}}">
239
240
</div>
240
241
</form>
You can’t perform that action at this time.
0 commit comments