mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Use project's redirect url instead of composing url (#33058)
Fix #32992 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 20c7fba60157067252af49da41b6f8929a5ae31a) Conflicts: routers/web/repo/issue_new.go the function is at routers/web/repo/issue.go in Forgejo
This commit is contained in:
parent
15ff226a5b
commit
81f30218cf
4 changed files with 26 additions and 11 deletions
|
@ -183,7 +183,7 @@ func ChangeProjectStatus(ctx *context.Context) {
|
|||
ctx.NotFoundOrServerError("ChangeProjectStatusByRepoIDAndID", project_model.IsErrProjectNotExist, err)
|
||||
return
|
||||
}
|
||||
ctx.JSONRedirect(fmt.Sprintf("%s/projects/%d", ctx.Repo.RepoLink, id))
|
||||
ctx.JSONRedirect(project_model.ProjectLinkForRepo(ctx.Repo.Repository, id))
|
||||
}
|
||||
|
||||
// DeleteProject delete a project
|
||||
|
@ -237,7 +237,7 @@ func RenderEditProject(ctx *context.Context) {
|
|||
ctx.Data["content"] = p.Description
|
||||
ctx.Data["card_type"] = p.CardType
|
||||
ctx.Data["redirect"] = ctx.FormString("redirect")
|
||||
ctx.Data["CancelLink"] = fmt.Sprintf("%s/projects/%d", ctx.Repo.Repository.Link(), p.ID)
|
||||
ctx.Data["CancelLink"] = project_model.ProjectLinkForRepo(ctx.Repo.Repository, p.ID)
|
||||
|
||||
ctx.HTML(http.StatusOK, tplProjectsNew)
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ func EditProjectPost(ctx *context.Context) {
|
|||
ctx.Data["PageIsEditProjects"] = true
|
||||
ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(unit.TypeProjects)
|
||||
ctx.Data["CardTypes"] = project_model.GetCardConfig()
|
||||
ctx.Data["CancelLink"] = fmt.Sprintf("%s/projects/%d", ctx.Repo.Repository.Link(), projectID)
|
||||
ctx.Data["CancelLink"] = project_model.ProjectLinkForRepo(ctx.Repo.Repository, projectID)
|
||||
|
||||
if ctx.HasError() {
|
||||
ctx.HTML(http.StatusOK, tplProjectsNew)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue