File tree Expand file tree Collapse file tree 6 files changed +16
-4
lines changed Expand file tree Collapse file tree 6 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ func EditProject(ctx *context.Context) {
234234
235235 ctx .Data ["title" ] = p .Title
236236 ctx .Data ["content" ] = p .Description
237+ ctx .Data ["redirect" ] = ctx .FormString ("redirect" )
237238
238239 ctx .HTML (http .StatusOK , tplProjectsNew )
239240}
@@ -274,7 +275,11 @@ func EditProjectPost(ctx *context.Context) {
274275 }
275276
276277 ctx .Flash .Success (ctx .Tr ("repo.projects.edit_success" , p .Title ))
277- ctx .Redirect (ctx .Repo .RepoLink + "/projects" )
278+ if ctx .FormString ("redirect" ) == "project" {
279+ ctx .Redirect (p .Link ())
280+ } else {
281+ ctx .Redirect (ctx .ContextUser .HomeLink () + "/-/projects" )
282+ }
278283}
279284
280285// ViewProject renders the project board for a project
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ func EditProject(ctx *context.Context) {
235235 ctx .Data ["title" ] = p .Title
236236 ctx .Data ["content" ] = p .Description
237237 ctx .Data ["card_type" ] = p .CardType
238+ ctx .Data ["redirect" ] = ctx .FormString ("redirect" )
238239
239240 ctx .HTML (http .StatusOK , tplProjectsNew )
240241}
@@ -275,7 +276,11 @@ func EditProjectPost(ctx *context.Context) {
275276 }
276277
277278 ctx .Flash .Success (ctx .Tr ("repo.projects.edit_success" , p .Title ))
278- ctx .Redirect (ctx .Repo .RepoLink + "/projects" )
279+ if ctx .FormString ("redirect" ) == "project" {
280+ ctx .Redirect (p .Link ())
281+ } else {
282+ ctx .Redirect (ctx .Repo .RepoLink + "/projects" )
283+ }
279284}
280285
281286// ViewProject renders the project board for a project
Original file line number Diff line number Diff line change 2121 <form class="ui form grid" action="{{.Link}}" method="post">
2222 {{.CsrfTokenHtml}}
2323 <div class="eleven wide column">
24+ <input type="hidden" id="redirect" name="redirect" value="{{.redirect}}">
2425 <div class="field {{if .Err_Title}}error{{end}}">
2526 <label>{{.locale.Tr "repo.projects.title"}}</label>
2627 <input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required>
Original file line number Diff line number Diff line change 4646 {{if $.CanWriteProjects}}
4747 <div class="column right aligned">
4848 <div class="ui compact right small menu">
49- <a class="item" href="{{$.Link}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
49+ <a class="item" href="{{$.Link}}/edit?redirect=project " data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
5050 {{svg "octicon-pencil"}}
5151 <span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
5252 </a>
Original file line number Diff line number Diff line change 2424 <form class="ui form grid" action="{{.Link}}" method="post">
2525 {{.CsrfTokenHtml}}
2626 <div class="eleven wide column">
27+ <input type="hidden" id="redirect" name="redirect" value="{{.redirect}}">
2728 <div class="field {{if .Err_Title}}error{{end}}">
2829 <label>{{.locale.Tr "repo.projects.title"}}</label>
2930 <input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required>
Original file line number Diff line number Diff line change 5050 {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
5151 <div class="column right aligned">
5252 <div class="ui compact right small menu">
53- <a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
53+ <a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit?redirect=project " data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
5454 {{svg "octicon-pencil"}}
5555 <span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
5656 </a>
You can’t perform that action at this time.
0 commit comments