添加静态模板

This commit is contained in:
2025-09-08 07:24:28 +00:00
parent b4bb4896af
commit 6df94872b3
8 changed files with 126 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
package repo
import (
"net/http"
"code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/services/context"
)
const (
tplCreateFromTemplate templates.TplName = "repo/create-from-template/create-from-template"
)
func CreateFromTemplate(ctx *context.Context) {
createCommon(ctx)
if ctx.Written() {
return
}
ctx.HTML(http.StatusOK, tplCreateFromTemplate)
}

View File

@@ -709,7 +709,7 @@ func MoveIssues(ctx *context.Context) {
for _, issue := range movedIssues {
if issue.RepoID != project.RepoID {
ctx.ServerError("Some issue's repoID is not equal to project's repoID", errors.New("Some issue's repoID is not equal to project's repoID"))
ctx.ServerError("Some issue's repoID is not equal to project's repoID", errors.New("some issue's repoID is not equal to project's repoID"))
return
}
}

View File

@@ -1022,6 +1022,7 @@ func registerWebRoutes(m *web.Router) {
m.Group("/repo", func() {
m.Get("/create", repo.Create)
m.Post("/create", web.Bind(forms.CreateRepoForm{}), repo.CreatePost)
m.Get("/create-from-template", repo.CreateFromTemplate)
m.Get("/migrate", repo.Migrate)
m.Post("/migrate", web.Bind(forms.MigrateRepoForm{}), repo.MigratePost)
m.Get("/search", repo.SearchRepo)