mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -235,6 +235,7 @@ func EditProject(ctx *context.Context) {
 | 
			
		||||
	ctx.Data["title"] = p.Title
 | 
			
		||||
	ctx.Data["content"] = p.Description
 | 
			
		||||
	ctx.Data["card_type"] = p.CardType
 | 
			
		||||
	ctx.Data["redirect"] = ctx.FormString("redirect")
 | 
			
		||||
 | 
			
		||||
	ctx.HTML(http.StatusOK, tplProjectsNew)
 | 
			
		||||
}
 | 
			
		||||
@@ -275,7 +276,11 @@ func EditProjectPost(ctx *context.Context) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ctx.Flash.Success(ctx.Tr("repo.projects.edit_success", p.Title))
 | 
			
		||||
	ctx.Redirect(ctx.Repo.RepoLink + "/projects")
 | 
			
		||||
	if ctx.FormString("redirect") == "project" {
 | 
			
		||||
		ctx.Redirect(p.Link())
 | 
			
		||||
	} else {
 | 
			
		||||
		ctx.Redirect(ctx.Repo.RepoLink + "/projects")
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ViewProject renders the project board for a project
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user