File tree 6 files changed +16
-4
lines changed 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) {
234
234
235
235
ctx .Data ["title" ] = p .Title
236
236
ctx .Data ["content" ] = p .Description
237
+ ctx .Data ["redirect" ] = ctx .FormString ("redirect" )
237
238
238
239
ctx .HTML (http .StatusOK , tplProjectsNew )
239
240
}
@@ -274,7 +275,11 @@ func EditProjectPost(ctx *context.Context) {
274
275
}
275
276
276
277
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
+ }
278
283
}
279
284
280
285
// 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) {
235
235
ctx .Data ["title" ] = p .Title
236
236
ctx .Data ["content" ] = p .Description
237
237
ctx .Data ["card_type" ] = p .CardType
238
+ ctx .Data ["redirect" ] = ctx .FormString ("redirect" )
238
239
239
240
ctx .HTML (http .StatusOK , tplProjectsNew )
240
241
}
@@ -275,7 +276,11 @@ func EditProjectPost(ctx *context.Context) {
275
276
}
276
277
277
278
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
+ }
279
284
}
280
285
281
286
// ViewProject renders the project board for a project
Original file line number Diff line number Diff line change 21
21
<form class="ui form grid" action="{{.Link}}" method="post">
22
22
{{.CsrfTokenHtml}}
23
23
<div class="eleven wide column">
24
+ <input type="hidden" id="redirect" name="redirect" value="{{.redirect}}">
24
25
<div class="field {{if .Err_Title}}error{{end}}">
25
26
<label>{{.locale.Tr "repo.projects.title"}}</label>
26
27
<input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required>
Original file line number Diff line number Diff line change 46
46
{{if $.CanWriteProjects}}
47
47
<div class="column right aligned">
48
48
<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}}>
50
50
{{svg "octicon-pencil"}}
51
51
<span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
52
52
</a>
Original file line number Diff line number Diff line change 24
24
<form class="ui form grid" action="{{.Link}}" method="post">
25
25
{{.CsrfTokenHtml}}
26
26
<div class="eleven wide column">
27
+ <input type="hidden" id="redirect" name="redirect" value="{{.redirect}}">
27
28
<div class="field {{if .Err_Title}}error{{end}}">
28
29
<label>{{.locale.Tr "repo.projects.title"}}</label>
29
30
<input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required>
Original file line number Diff line number Diff line change 50
50
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
51
51
<div class="column right aligned">
52
52
<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}}>
54
54
{{svg "octicon-pencil"}}
55
55
<span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span>
56
56
</a>
You can’t perform that action at this time.
0 commit comments