diff options
author | yp05327 | 2023-03-09 23:38:29 +0900 |
---|---|---|
committer | GitHub | 2023-03-09 08:38:29 -0600 |
commit | e52ac62d8e645c721060e6c9a2b0ab77eedf8fd6 (patch) | |
tree | 2259ae04d96cfe1679bbee559c5e397c412b5015 /templates | |
parent | 8cadd51bf295e6ff36ac36efed68cc5de34c9382 (diff) |
Redirect to project again after editing it (#23326)
A part of https://github.com/go-gitea/gitea/pull/22865
We have edit buttons in projects list page and project view page.
But after user edit a project, it will always redirect to the projects
list page.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/projects/new.tmpl | 1 | ||||
-rw-r--r-- | templates/projects/view.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/projects/new.tmpl | 1 | ||||
-rw-r--r-- | templates/repo/projects/view.tmpl | 2 |
4 files changed, 4 insertions, 2 deletions
diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl index c96f948de..826869ac5 100644 --- a/templates/projects/new.tmpl +++ b/templates/projects/new.tmpl @@ -21,6 +21,7 @@ <form class="ui form grid" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="eleven wide column"> + <input type="hidden" id="redirect" name="redirect" value="{{.redirect}}"> <div class="field {{if .Err_Title}}error{{end}}"> <label>{{.locale.Tr "repo.projects.title"}}</label> <input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required> diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index 14a876d8f..474b22a2f 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -46,7 +46,7 @@ {{if or $.CanWriteIssues $.CanWritePulls}} <div class="column right aligned"> <div class="ui compact right small menu"> - <a class="item" href="{{$.Link}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}> + <a class="item" href="{{$.Link}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}> {{svg "octicon-pencil"}} <span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span> </a> diff --git a/templates/repo/projects/new.tmpl b/templates/repo/projects/new.tmpl index b65601c15..b53a47dc5 100644 --- a/templates/repo/projects/new.tmpl +++ b/templates/repo/projects/new.tmpl @@ -24,6 +24,7 @@ <form class="ui form grid" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <div class="eleven wide column"> + <input type="hidden" id="redirect" name="redirect" value="{{.redirect}}"> <div class="field {{if .Err_Title}}error{{end}}"> <label>{{.locale.Tr "repo.projects.title"}}</label> <input name="title" placeholder="{{.locale.Tr "repo.projects.title"}}" value="{{.title}}" autofocus required> diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index f6bc6e1a4..bef9cb9bf 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -50,7 +50,7 @@ {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} <div class="column right aligned"> <div class="ui compact right small menu"> - <a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}> + <a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}> {{svg "octicon-pencil"}} <span class="gt-mx-3">{{$.locale.Tr "repo.issues.label_edit"}}</span> </a> |